org.openqa.selenium.android
Class AndroidDriver
java.lang.Object
org.openqa.selenium.remote.RemoteWebDriver
org.openqa.selenium.android.AndroidDriver
- All Implemented Interfaces:
- HasCapabilities, HasInputDevices, BrowserConnection, FindsByClassName, FindsByCssSelector, FindsById, FindsByLinkText, FindsByName, FindsByTagName, FindsByXPath, JavascriptExecutor, Rotatable, SearchContext, TakesScreenshot, WebDriver
public class AndroidDriver
- extends RemoteWebDriver
- implements TakesScreenshot, Rotatable, BrowserConnection
A driver for running tests on an Android device or emulator.
Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver |
close, execute, execute, executeAsyncScript, executeScript, findElement, findElement, findElementByClassName, findElementByCssSelector, findElementById, findElementByLinkText, findElementByName, findElementByPartialLinkText, findElementByTagName, findElementByXPath, findElements, findElements, findElementsByClassName, findElementsByCssSelector, findElementsById, findElementsByLinkText, findElementsByName, findElementsByPartialLinkText, findElementsByTagName, findElementsByXPath, get, getCapabilities, getCommandExecutor, getCurrentUrl, getElementConverter, getErrorHandler, getExecuteMethod, getKeyboard, getMouse, getPageSource, getSessionId, getTitle, getWindowHandle, getWindowHandles, log, manage, navigate, newRemoteWebElement, quit, setCommandExecutor, setElementConverter, startClient, startSession, stopClient, switchTo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AndroidDriver
public AndroidDriver()
- The default constructor assumes the remote server is listening at
http://localhost:8080/hub
AndroidDriver
public AndroidDriver(String remoteAddress)
throws MalformedURLException
- Throws:
MalformedURLException
AndroidDriver
public AndroidDriver(URL remoteAddress)
AndroidDriver
public AndroidDriver(URL url,
DesiredCapabilities caps)
AndroidDriver
public AndroidDriver(DesiredCapabilities caps)
getScreenshotAs
public <X> X getScreenshotAs(OutputType<X> target)
throws WebDriverException
- Description copied from interface:
TakesScreenshot
- Capture the screenshot and store it in the specified location.
- Specified by:
getScreenshotAs
in interface TakesScreenshot
- Type Parameters:
X
- Return type for getScreenshotAs.- Parameters:
target
- target type, @see OutputType
- Returns:
- Object in which is stored information about the screenshot.
- Throws:
WebDriverException
- on failure.
isOnline
public boolean isOnline()
- Specified by:
isOnline
in interface BrowserConnection
- Returns:
- true if the application is online, false otherwise
setOnline
public void setOnline(boolean online)
throws WebDriverException
- Description copied from interface:
BrowserConnection
- Changes the application online state.
- Specified by:
setOnline
in interface BrowserConnection
- Parameters:
online
- A boolean representing the state
- Throws:
WebDriverException
rotate
public void rotate(ScreenOrientation orientation)
- Description copied from interface:
Rotatable
- Changes the orientation of the browser window.
- Specified by:
rotate
in interface Rotatable
- Parameters:
orientation
- the desired screen orientation
getOrientation
public ScreenOrientation getOrientation()
- Specified by:
getOrientation
in interface Rotatable
- Returns:
- the current screen orientation of the browser
Copyright © 2011. All Rights Reserved.