org.openqa.selenium.remote
Class RemoteWebDriver.RemoteTargetLocator

java.lang.Object
  extended by org.openqa.selenium.remote.RemoteWebDriver.RemoteTargetLocator
All Implemented Interfaces:
WebDriver.TargetLocator
Enclosing class:
RemoteWebDriver

protected class RemoteWebDriver.RemoteTargetLocator
extends Object
implements WebDriver.TargetLocator


Constructor Summary
protected RemoteWebDriver.RemoteTargetLocator()
           
 
Method Summary
 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.
 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 frameIndex)
          Select a frame by its (zero-based) index.
 WebDriver frame(String frameName)
          Select a frame by its name or ID.
 WebDriver frame(WebElement frameElement)
          Select a frame using its previously located WebElement.
 WebDriver window(String windowName)
          Switch the focus of future commands for this driver to the window with the given name/handle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteWebDriver.RemoteTargetLocator

protected RemoteWebDriver.RemoteTargetLocator()
Method Detail

frame

public WebDriver frame(int frameIndex)
Description copied from interface: WebDriver.TargetLocator
Select a frame by its (zero-based) index. That is, if a page has three frames, the first frame would be at index "0", the second at index "1" and the third at index "2". Once the frame has been selected, all subsequent calls on the WebDriver interface are made to that frame.

Specified by:
frame in interface WebDriver.TargetLocator
Parameters:
frameIndex - (zero-based) index
Returns:
This driver focused on the given frame

frame

public WebDriver frame(String frameName)
Description copied from interface: WebDriver.TargetLocator
Select a frame by its name or ID. Frames located by matching name attributes are always given precedence over those matched by ID.

Specified by:
frame in interface WebDriver.TargetLocator
Parameters:
frameName - the name of the frame window, the id of the <frame> or <iframe> element, or the (zero-based) index
Returns:
This driver focused on the given frame

frame

public WebDriver frame(WebElement frameElement)
Description copied from interface: WebDriver.TargetLocator
Select a frame using its previously located WebElement.

Specified by:
frame in interface WebDriver.TargetLocator
Parameters:
frameElement - The frame element to switch to.
Returns:
This driver focused on the given frame.
See Also:
WebDriver.findElement(By)

window

public WebDriver window(String windowName)
Description copied from interface: WebDriver.TargetLocator
Switch the focus of future commands for this driver to the window with the given name/handle.

Specified by:
window in interface WebDriver.TargetLocator
Parameters:
windowName - The name of the window or the handle as returned by WebDriver.getWindowHandle()
Returns:
This driver focused on the given window

defaultContent

public WebDriver defaultContent()
Description copied from interface: WebDriver.TargetLocator
Selects either the first frame on the page, or the main document when a page contains iframes.

Specified by:
defaultContent in interface WebDriver.TargetLocator
Returns:
This driver focused on the top window/first frame.

activeElement

public WebElement activeElement()
Description copied from interface: WebDriver.TargetLocator
Switches to the element that currently has focus within the document currently "switched to", or the body element if this cannot be detected. This matches the semantics of calling "document.activeElement" in Javascript.

Specified by:
activeElement in interface WebDriver.TargetLocator
Returns:
The WebElement with focus, or the body element if no element with focus can be detected.

alert

public Alert alert()
Description copied from interface: WebDriver.TargetLocator
Switches to the currently active modal dialog for this particular driver instance.

Specified by:
alert in interface WebDriver.TargetLocator
Returns:
A handle to the dialog.


Copyright © 2011. All Rights Reserved.