fayrehouse
12 years agoFrequent Contributor
Currently foregrounded page
Folks,
Our website being tested has (as most sites do!) a number of links/buttons you can click on for various reasons. Some of these load a different URL in the current page, some open a document (eg PDF), others open a new window, some cause some back end processing to begin (which MAY take several seconds) etc.
I have a function that clicks on the object, regardless of type etc (identifying the correct object by "meaningful" text identifier - which isn't ALWAYS contentText!) - and I need it to wait for the system to finish doing whatever. For the most part, all is well. Except for when a new window is produced.
Depending on the link, the for the new window can vary. This, together with the use of the above "click" function I described, I cannot do something like
Sys.Browser().Page("http://some.specific.url").Wait()
Sys.Browser().Refresh
And if I try something generic:
Sys.Browser().Page("*").Wait()
Sys.Browser().Refresh
This matches against the "parent" page, and decides there is nothing to wait for.
Can anyone advise of a way (non Browser specific, as I have to test across FF, IE, Chrome and Safari) of identifying the current foreground web page - and using that in the Sys.Browser().Page("SOMEURL").Wait() ??
Thanks
Steve
Our website being tested has (as most sites do!) a number of links/buttons you can click on for various reasons. Some of these load a different URL in the current page, some open a document (eg PDF), others open a new window, some cause some back end processing to begin (which MAY take several seconds) etc.
I have a function that clicks on the object, regardless of type etc (identifying the correct object by "meaningful" text identifier - which isn't ALWAYS contentText!) - and I need it to wait for the system to finish doing whatever. For the most part, all is well. Except for when a new window is produced.
Depending on the link, the for the new window can vary. This, together with the use of the above "click" function I described, I cannot do something like
Sys.Browser().Page("http://some.specific.url").Wait()
Sys.Browser().Refresh
And if I try something generic:
Sys.Browser().Page("*").Wait()
Sys.Browser().Refresh
This matches against the "parent" page, and decides there is nothing to wait for.
Can anyone advise of a way (non Browser specific, as I have to test across FF, IE, Chrome and Safari) of identifying the current foreground web page - and using that in the Sys.Browser().Page("SOMEURL").Wait() ??
Thanks
Steve
Hi Steve,
Try modifying the Window Registry to make IE show all pages in one window. Refer to the "Preparing Internet Explorer for Web Testing" article for details.
Does this help?