navigation browser / page
Hi everybody.
I would like to declare the page (browser) because I need it later to access on it on other objects. The necessary page is already open.
I used:
function DB() {
var url = "http://.............../";
Browsers.Item(btChrome).Run(url);
var page = Sys.Browser("*").Page(url);
Sys.Browser().BrowserWindow(0).Maximize();
...
}
When I use it, the page will a kind of "refresh" with this code.
What can you alternatively recommend me how to do it?
Thank you very much in advance!
Even easier than that.
function getMyPage(url){ return Sys.Browser('chrome').Page(url); }
That is, assuming that the desired page exists.
In truth, though, I would map the object. So, there would be, in my NameMapping, something like
Aliases.browser.pageMyPage
the pageMyPage object would have as the identifying properties the ObjectType of Page and then url being the the url. Then, everytime I want to reference that page in my code, all I need to do is reference the Alias.
And, one step further, if I want to make sure, when I'm referencing the page, that it actually exists and do validation on it (like if I click a button and expect a particular page), I can do something like
Aliases.browser.myFirstPage.myNavigateButton.ClickButton(); if (!Aliases.browser.WaitAliasChild('mySecondPage', -1).Exists){ throw Error('The desired page did not come up after clicking on my button'); }