Forum Discussion

jesse2's avatar
jesse2
Occasional Contributor
6 years ago
Solved

Opening new tab in Firefox 60.0 returns wrong URL with Page("*").URL

In TestComplete 12.50.4142, I'm using Firefox 60.0 to open a new tab and verify the URL matches the URL in another tab. When I do this in IE or Chrome, it works fine. But when I try it in Firefox it fails.

 

I'm using Sys.Browser().Page("*").URL to pull the URL on the second tab and it is always returning "about:newtab" instead of the actual URL "http://localhost".

 

If I use Sys.Browser().Page("*").URL to pull the URL from the first tab, it reports "http://localhost".

 

I tried adding check for WaitPage("http://localhost") and it still fails.

 

Is this a bug? Both Firefox and TestComplete are up to date all the way.

 

I already ran through https://support.smartbear.com/testcomplete/docs/app-testing/web/general/preparing-browsers/firefox.html for setting up Firefox.

 

  • This code Sys.Browser().Page("*").URL will return the first page that matches the wildcard.  In the TestComplete hierarchy, this search goes from bottom to top.  If you look in your object browser, you'll see that the bottom most page in FireFox is most likely that about:blank tab.  

     

    A suggestion for your test:

     

    Use a call from the browser of FindAllChildren that are a Page object type with the desired URL.  Do this as your first step.  That will return an array.  Get the array length and store it.  Then, click on your link that's supposed to open your new tab.  Now, repeat the FindAllChildren.  Get the resulting array length. Compare the two.  The second value, on a PASS, should be 1 higher than the first value.

5 Replies