Forum Discussion
tristaanogre
7 years agoEsteemed Contributor
Every URL is a "page" in the object tree of TestComplete. So, simply selecting Browser.Page('*') isn't going to get the current page necessarily. The "current" page is identifed by whether or not the "Visible" property is true.
So, in your getURL, I would actually search for whatever page object is currently visible.
function getURL(){ var browser = Sys.Browser("Chrome"); var page = browser.FindChild(["ObjectType", "Visible"],["Page", true], 0); var url = page.URL; return url; }
Adagio
7 years agoFrequent Contributor
Thank you, Robert!
I tired this solution, and it worked well the first time, but when I was re-running the tests, same old thing started occuring again. It was closing the main dashboard page.
Thank you
Abhi
- tristaanogre7 years agoEsteemed Contributor
Another possiblity then is a timing issue. If your code to close the tab is happening before the tab is recognized by TestComplete's object recognition, that could be the issue. That's basically what this seems to be.