I'm new to Jscript. I am trying to open a page, and wait for the page to finish loading, then enter the Username and Password and hit enter.
Steps are:
1. Open webpage in IE7
2. Wait for page to load
3. Enter Username and Password, {enter}
4. Wait for page to load
5. Open second page on second tab in IE7
I'm struggling with 'wait for page to open' and entering username and password in Jscript.
I've tried the readystate != (4) in a while loop, but I keep getting an error.
Any ideas? Code below:
var navOpenInBackgroundTab = 0x1000;
var oIE = new ActiveXObject("InternetExplorer.Application");
oIE.Navigate2("https://mail.google.com/a/sabic-ip.com/");
oIE.Visible = true;
While (oIE.readyState != 4) //This does not work in Jscript.
{
WScript.Sleep (1000);
}
oIE.Navigate2("https://calendar.google.com/a/sabic-ip.com/", navOpenInBackgroundTab);
WScript.Quit(1)