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 ...
  • tristaanogre's avatar
    tristaanogre
    6 years ago

    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.