Forum Discussion
Dmitry_Nikolaev
15 years agoStaff
Hi Alison,
A good approach is to avoid working with several browser windows during tests to avoid possible name conflicts.
Here is a script that does what you want:
function test()
{
var page = Sys.Process("iexplore").Page("http://www.google.com/");
var frame = getFrameForPage(page);
if (null != frame) {
frame.Maximize();
}
}
function getFrameForPage(page)
{
var frames = Sys.Process("iexplore").FindAllChildren("RecordClass", "IEFrame").toArray();
for (var i = 0; i < frames.length; i++) {
var fPage = frames.FindChild("ObjectType", "Page", 10);
if (true == fPage.Exists) {
if (fPage.LocationURL == page.LocationURL) {
return frames;
}
}
}
return null;
}
Related Content
- 11 years ago
Recent Discussions
- 13 hours ago
- 14 hours ago