public static interface WebDriver.TargetLocator
| Modifier and Type | Method and Description |
|---|---|
WebElement |
activeElement()
Switches to the element that currently has focus within the document currently "switched to",
or the body element if this cannot be detected.
|
org.openqa.selenium.Alert |
alert()
Switches to the currently active modal dialog for this particular driver instance.
|
WebDriver |
defaultContent()
Selects either the first frame on the page, or the main document when a page contains
iframes.
|
WebDriver |
frame(int index)
Select a frame by its (zero-based) index.
|
WebDriver |
frame(String nameOrId)
Select a frame by its name or ID.
|
WebDriver |
frame(WebElement frameElement)
Select a frame using its previously located
WebElement. |
WebDriver |
parentFrame()
Change focus to the parent context.
|
WebDriver |
window(String nameOrHandle)
Switch the focus of future commands for this driver to the window with the given name/handle.
|
WebDriver frame(int index)
index - (zero-based) indexNoSuchFrameException - If the frame cannot be foundWebDriver frame(String nameOrId)
nameOrId - the name of the frame window, the id of the <frame> or <iframe>
element, or the (zero-based) indexNoSuchFrameException - If the frame cannot be foundWebDriver frame(WebElement frameElement)
WebElement.frameElement - The frame element to switch to.NoSuchFrameException - If the given element is neither an IFRAME nor a FRAME element.StaleElementReferenceException - If the WebElement has gone stale.WebDriver.findElement(By)WebDriver parentFrame()
WebDriver window(String nameOrHandle)
nameOrHandle - The name of the window or the handle as returned by
WebDriver.getWindowHandle()NoSuchWindowException - If the window cannot be foundWebDriver defaultContent()
WebElement activeElement()
org.openqa.selenium.Alert alert()
NoAlertPresentException - If the dialog cannot be foundCopyright © 2016. All rights reserved.