Forum Discussion
tristaanogre
8 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
8 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