Ask a Question

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

SOLVED
jesse2
Occasional Contributor

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.h... for setting up Firefox.

 

1 ACCEPTED SOLUTION

Accepted Solutions
tristaanogre
Community Hero

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

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

5 REPLIES 5
Marsha_R
Community Hero

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

Do you have patch for Firefox 60 from here?

https://support.smartbear.com/downloads/testcomplete/firefox-patches/


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
jesse2
Occasional Contributor

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

Thanks for the fast reply Marsha.

 

I hadn't applied the patch, but after doing so, I am still experiencing the problem.

Marsha_R
Community Hero

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

Did this work for you in an earlier version of TC and/or Firefox?  If so, what version?


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
tristaanogre
Community Hero

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

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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
jesse2
Occasional Contributor

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

I think you solved the mystery. After opening a new tab, I'm getting two "new" pages in the Object Browser. A page for "about:newtab" and the new "localhost" page that I was looking for and hierarchical wise appears to be finding the "about:newtab" first. I haven't implemented a solution yet, but I see where the issue is. Thank you.

 

Firefox.png

cancel
Showing results for 
Search instead for 
Did you mean: