Forum Discussion
AlexeyKolosov
Staff
15 years agoHi Anand,
In case of opening several windows, the Internet Explorer process that corresponds to the latest window has the largest index. You can use the WaitProcess method to get the latest instance. Note that the script below assumes that there is at least one Internet Explorer window open:
index = 1
Do Until index=0
index = index + 1
If Not Sys.WaitProcess("iexplore", 0, index).Exists Then
Exit Do
End If
Loop
Log.Message("The latest launched window has the " & Sys.Process("iexplore", index - 1).Page("*").URL & " URL")
To get the active window, use the Sys.Desktop.ActiveWindow method.
As for the tabs, we do not recommend that you use tabbed browsing in your tests.
Please clarify your task so we can try to suggest you another possible approach.