public class WindowSelector extends Object
| Constructor and Description |
|---|
WindowSelector() |
| Modifier and Type | Method and Description |
|---|---|
static WindowSelector |
getInstance()
Get WindowSelector instance.
|
String |
selectBlankWindow(Context context)
Select blank window.
|
String |
selectPopUp(Context context,
String windowID) |
String |
selectPreviousWindow(Context context)
Select window without current selected.
|
String |
selectWindow(Context context,
String windowID)
Select window.
|
String |
selectWindowWithTitle(Context context,
String title)
Select window with title.
|
static void |
setInstance(WindowSelector ws)
Set WindowSelector instance.
|
static void |
waitAfterSelectingWindowIfNeed(Context context)
Wait after selecting a window if the browser is Firefox.
|
public static void setInstance(WindowSelector ws)
ws - WindowSelector instance.public static WindowSelector getInstance()
public String selectWindow(Context context, String windowID)
context - Selenese Runner context.windowID - window ID.
The following text is copied from:
https://github.com/SeleniumHQ/selenium/blob/master/ide/main/src/content/selenium-core/reference.html
(Note: "var=" is not supported with the restrictions of Selenium WebDriver)
Selects a popup window using a window locator; once a popup window has been selected, all commands go to that window. To select the main window again, use null as the target.
Window locators provide different ways of specifying the window object: by title, by internal JavaScript "name," or by JavaScript variable.
If no window locator prefix is provided, we'll try to guess what you mean like this:
selectWindow(Context, String) does not try looping)
If you're having trouble figuring out the name of a window that you want to manipulate, look at the Selenium log messages which identify the names of windows created via window.open (and therefore intercepted by Selenium). You will see messages like the following for each window as it is opened:
debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"
In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). (This is bug SEL-339.) In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using an empty (blank) url, like this: openWindow("", "myFunnyWindow").
Arguments:
windowID - the JavaScript window ID of the window to select
public String selectPopUp(Context context, String windowID)
context - Selenese Runner context.windowID - windowID.public String selectPreviousWindow(Context context)
context - Selenese Runner context.public String selectWindowWithTitle(Context context, String title)
context - Selenese Runner context.title - window title.public String selectBlankWindow(Context context)
context - Selenese Runner context.public static void waitAfterSelectingWindowIfNeed(Context context)
context - Selenese Runner context.Copyright © 2017. All rights reserved.