public class AndroidWebDriver extends Object implements org.openqa.selenium.WebDriver, org.openqa.selenium.SearchContext, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.Rotatable, org.openqa.selenium.html5.BrowserConnection, org.openqa.selenium.interactions.HasTouchScreen, org.openqa.selenium.html5.WebStorage, org.openqa.selenium.html5.LocationContext, android.location.LocationListener, org.openqa.selenium.html5.ApplicationCache
org.openqa.selenium.WebDriver.ImeHandler, org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window| Constructor and Description |
|---|
AndroidWebDriver(android.app.Activity activity)
Use this contructor to use WebDriver with a WebView that has the same settings as
the Android browser.
|
AndroidWebDriver(android.app.Activity activity,
ViewFactory viewFactory,
ViewClientWrapper viewClient,
ChromeClientWrapper chromeClient)
Use this constructor to use WebDriver with a custom view.
|
AndroidWebDriver(android.app.Activity activity,
ViewFactory viewFactory,
ViewClientWrapper viewClient,
ChromeClientWrapper chromeClient,
android.view.View.OnFocusChangeListener focusListener)
Use this constructor to use WebDriver with a custom view and a custom
View.OnFocusChangeListener for that view..
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Object |
executeAsyncScript(String script,
Object... args) |
Object |
executeScript(String script,
Object... args) |
org.openqa.selenium.WebElement |
findElement(org.openqa.selenium.By by) |
List<org.openqa.selenium.WebElement> |
findElements(org.openqa.selenium.By by) |
void |
get(String url) |
boolean |
getAcceptSslCerts() |
android.app.Activity |
getActivity() |
String |
getCurrentUrl() |
org.openqa.selenium.html5.LocalStorage |
getLocalStorage() |
org.openqa.selenium.ScreenOrientation |
getOrientation() |
String |
getPageSource() |
<X> X |
getScreenshotAs(org.openqa.selenium.OutputType<X> target) |
org.openqa.selenium.html5.SessionStorage |
getSessionStorage() |
org.openqa.selenium.html5.AppCacheStatus |
getStatus() |
String |
getTitle() |
org.openqa.selenium.interactions.TouchScreen |
getTouch() |
Object |
getView() |
android.webkit.WebView |
getWebView() |
String |
getWindowHandle() |
Set<String> |
getWindowHandles() |
boolean |
isJavascriptEnabled() |
boolean |
isOnline() |
org.openqa.selenium.html5.Location |
location() |
org.openqa.selenium.WebDriver.Options |
manage() |
org.openqa.selenium.WebDriver.Navigation |
navigate() |
void |
onLocationChanged(android.location.Location location) |
void |
onProviderDisabled(String s) |
void |
onProviderEnabled(String s) |
void |
onStatusChanged(String s,
int i,
android.os.Bundle bundle) |
protected Object |
processJsonObject(Object res) |
void |
quit() |
void |
rotate(org.openqa.selenium.ScreenOrientation orientation) |
void |
setAcceptSslCerts(boolean accept) |
void |
setLocation(org.openqa.selenium.html5.Location loc) |
void |
setOnline(boolean online) |
void |
setProxy(String host,
int port) |
org.openqa.selenium.WebDriver.TargetLocator |
switchTo() |
public AndroidWebDriver(android.app.Activity activity)
activity - the activity context where the WebView will be created.public AndroidWebDriver(android.app.Activity activity,
ViewFactory viewFactory,
ViewClientWrapper viewClient,
ChromeClientWrapper chromeClient)
activity - the activity context where the view will be displayed.viewFactory - a implementation of the ViewFactory interface. WebDriver will
use this creation mechanism to create views when needed (e.g. when clicking on a link
that opens a new window).viewClient - the ViewClientWrapper used by the custom WebView.chromeClient - the ChromeClientWrapper used by the custom WebView.public AndroidWebDriver(android.app.Activity activity,
ViewFactory viewFactory,
ViewClientWrapper viewClient,
ChromeClientWrapper chromeClient,
android.view.View.OnFocusChangeListener focusListener)
activity - the activity context where the view will be displayed.viewFactory - a implementation of the ViewFactory interface. WebDriver will
use this creation mechanism to create views when needed (e.g. when clicking on a link
that opens a new window).viewClient - the ViewClientWrapper used by the custom WebView.chromeClient - the ChromeClientWrapper used by the custom WebView.focusListener - the listener used by the view that will be created by the viewFactory.public void setAcceptSslCerts(boolean accept)
public boolean getAcceptSslCerts()
public android.webkit.WebView getWebView()
public Object getView()
public android.app.Activity getActivity()
public String getCurrentUrl()
getCurrentUrl in interface org.openqa.selenium.WebDriverpublic String getTitle()
getTitle in interface org.openqa.selenium.WebDriverpublic void get(String url)
get in interface org.openqa.selenium.WebDriverpublic String getPageSource()
getPageSource in interface org.openqa.selenium.WebDriverpublic void close()
close in interface org.openqa.selenium.WebDriverpublic void quit()
quit in interface org.openqa.selenium.WebDriverpublic org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)
findElement in interface org.openqa.selenium.SearchContextfindElement in interface org.openqa.selenium.WebDriverpublic List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By by)
findElements in interface org.openqa.selenium.SearchContextfindElements in interface org.openqa.selenium.WebDriverpublic org.openqa.selenium.html5.AppCacheStatus getStatus()
getStatus in interface org.openqa.selenium.html5.ApplicationCachepublic Set<String> getWindowHandles()
getWindowHandles in interface org.openqa.selenium.WebDriverpublic String getWindowHandle()
getWindowHandle in interface org.openqa.selenium.WebDriverpublic org.openqa.selenium.WebDriver.TargetLocator switchTo()
switchTo in interface org.openqa.selenium.WebDriverpublic org.openqa.selenium.html5.LocalStorage getLocalStorage()
getLocalStorage in interface org.openqa.selenium.html5.WebStoragepublic org.openqa.selenium.html5.SessionStorage getSessionStorage()
getSessionStorage in interface org.openqa.selenium.html5.WebStoragepublic org.openqa.selenium.WebDriver.Navigation navigate()
navigate in interface org.openqa.selenium.WebDriverpublic boolean isJavascriptEnabled()
public Object executeScript(String script, Object... args)
executeScript in interface org.openqa.selenium.JavascriptExecutorpublic Object executeAsyncScript(String script, Object... args)
executeAsyncScript in interface org.openqa.selenium.JavascriptExecutorprotected Object processJsonObject(Object res) throws org.json.JSONException
org.json.JSONExceptionpublic void setProxy(String host, int port)
public org.openqa.selenium.WebDriver.Options manage()
manage in interface org.openqa.selenium.WebDriverpublic org.openqa.selenium.html5.Location location()
location in interface org.openqa.selenium.html5.LocationContextpublic void setLocation(org.openqa.selenium.html5.Location loc)
setLocation in interface org.openqa.selenium.html5.LocationContextpublic void onLocationChanged(android.location.Location location)
onLocationChanged in interface android.location.LocationListenerpublic void onStatusChanged(String s, int i, android.os.Bundle bundle)
onStatusChanged in interface android.location.LocationListenerpublic void onProviderEnabled(String s)
onProviderEnabled in interface android.location.LocationListenerpublic void onProviderDisabled(String s)
onProviderDisabled in interface android.location.LocationListenerpublic <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target)
throws org.openqa.selenium.WebDriverException
getScreenshotAs in interface org.openqa.selenium.TakesScreenshotorg.openqa.selenium.WebDriverExceptionpublic org.openqa.selenium.ScreenOrientation getOrientation()
getOrientation in interface org.openqa.selenium.Rotatablepublic void rotate(org.openqa.selenium.ScreenOrientation orientation)
rotate in interface org.openqa.selenium.Rotatablepublic boolean isOnline()
isOnline in interface org.openqa.selenium.html5.BrowserConnectionpublic void setOnline(boolean online)
throws org.openqa.selenium.WebDriverException
setOnline in interface org.openqa.selenium.html5.BrowserConnectionorg.openqa.selenium.WebDriverExceptionpublic org.openqa.selenium.interactions.TouchScreen getTouch()
getTouch in interface org.openqa.selenium.interactions.HasTouchScreenCopyright © 2013. All rights reserved.