What I am seeing is the McAfee SiteAdvisor image at the top right corner of the IE browser when the browser opens. When TestComplete attempts to navigate to a given page it appears to enter the url in SiteAdvisor and then SiteAdvisor changes from the image to a scroll bar and the test fails because it continues to focus on SiteAdvisor.
I found these 2 post on a different forum for the same issue but no fix.
http://www.sqaforums.com/forums/hp-functional-testing-mercury-quicktest-pro-qtp/133022-browser-navigate-does-not-do-anything.html I'm back up and running now because they turn off SiteAdvisor on my computer until someone comes up with a good fix.
I was able to get it to work most of the time in IE9 but it was not 100% reliable and it would not work in Chrome or FF. Here is want I was able to come up with:
In TestComplete:
- Double click on Project in the Project Explorer.
- In Workspace click on the Properties tab at the bottom of the screen.
- Click to view "Playback" options.
- Uncheck "Click on focused control" under "On unexpected window".
Then I created the following script:
function urlLoginAndSearch()
{
Browsers.Item(btIExplorer).Run("about:blank");
Delay(3000);
Aliases.browser.BrowserWindow.WorkerW.ReBarWindow32.AddressBandRoot.Keys(Project.Variables.urlLoginAndSearch); //enters url in the address bar
Aliases.browser.BrowserWindow.WorkerW.ReBarWindow32.AddressBandRoot.Keys("[Enter]"); //same as clicking GO button
Aliases.browser.BrowserWindow.FrameTab.SetFocus(); //sets focus on the browser content frame
}
However, if you open a second browser tab and then close it TestComplete with fail. I had to leave tabs open and use getAddressbar. This is the script code I used:
function gotoLoginScreenMap()
{
Aliases.browser.csrLoginScreenMap.AddressBar; //csrLoginScreenMap in NameMapping
}
If anyone comes up with good fix to get around SiteAdvisor I would like to know. Thanks.