Forum Discussion
Pavel_1
15 years agoContributor
I've looked through the links also.
In the first one the problem is solved by FindTabProcess function, which returns the needed IE process by its main process and page.
In the second one it is proposed to use different name mapping configutrations (one for IE7 and lower, second for IE8 and third for FF).
But I don't quite understand how's it possible to get apropriate browser process in case of IE8.
I just used the fact that IE creates a new child process with higher index everytime opening a new tab (page)
I use projectsuite.variables to store the info about which browser is used for test ("IE" or "FF").
function GetBrowser()
{
var p,ind=1;
if (ProjectSuite.Variables("browser")=="IE")
while (Sys.WaitProcess("iexplore", 2000, ind).Exists)
{
p=Sys.Process("iexplore", ind);
ind++;
}
else if (ProjectSuite.Variables("browser")=="FF")
p = Sys.Process("firefox");
return p;
}
So you may use just GetBrowser() instead of the process object you take from mapping scheme after you've opened a new page,
like GetBrowser().WaitPage(...).
But I guess the approach like FindTabProcess in the first link can be better, you may try it also.
In the first one the problem is solved by FindTabProcess function, which returns the needed IE process by its main process and page.
In the second one it is proposed to use different name mapping configutrations (one for IE7 and lower, second for IE8 and third for FF).
But I don't quite understand how's it possible to get apropriate browser process in case of IE8.
I just used the fact that IE creates a new child process with higher index everytime opening a new tab (page)
I use projectsuite.variables to store the info about which browser is used for test ("IE" or "FF").
function GetBrowser()
{
var p,ind=1;
if (ProjectSuite.Variables("browser")=="IE")
while (Sys.WaitProcess("iexplore", 2000, ind).Exists)
{
p=Sys.Process("iexplore", ind);
ind++;
}
else if (ProjectSuite.Variables("browser")=="FF")
p = Sys.Process("firefox");
return p;
}
So you may use just GetBrowser() instead of the process object you take from mapping scheme after you've opened a new page,
like GetBrowser().WaitPage(...).
But I guess the approach like FindTabProcess in the first link can be better, you may try it also.
Related Content
Recent Discussions
- 6 hours agoSvetaG