|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openqa.selenium.android.library.ChromeClientWrapper
public class ChromeClientWrapper
This class wraps a chrome client that must have the *same* API as WebChromeClient. This chrome client will be used with the view used by WebDriver to monitor events.
Sample usage: // If the underlying view is a WebView, you can use WebDriver's default // chrome client assuming you don't have any custom bahavior defined in // WebView's WebChromeClient. ChromeClientWrapper chromeClient = new ChromeClientWrapper( "android.webkit.WebChromeClient", new DefaultChromeClient()); // If the underlying view is a WebView, you can use WebDriver default // chrome client with a custom WebChromeClient that defines the bahavior // you want. class MyCustomChromeClient extends WebChromeClient { ... } MyCustomChromeClient customChrome = new MyCustomChromeClient(); ChromeClientWrapper chromeClient = new ChromeClientWrapper( "android.webkit.WebChromeClient", new DefaultChromeClient(customChrome)) Note that WebDriver needs the DefaultChromeClient in order to be able to listen to events that happen on the page. If you don't want to use the DefaultChromeClient, you can write your own client under the condition that your client calls all WebDriverChromeClient methods.
| Constructor Summary | |
|---|---|
ChromeClientWrapper(java.lang.String className,
java.lang.Object client)
|
|
| Method Summary | |
|---|---|
void |
setDriver(AndroidWebDriver driver)
|
void |
setWebDriverView(org.openqa.selenium.android.library.WebDriverView view)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ChromeClientWrapper(java.lang.String className,
java.lang.Object client)
className - the fully qualified class name of the client's class.client - the client to use. Typically this client will be a
WebChromeClient (or extend the latter). if not this client must have
the same API methods as WebChromeClient. Additionally this chrome
client must implement the DriverProvider and ViewProvider interfaces.| Method Detail |
|---|
public void setDriver(AndroidWebDriver driver)
setDriver in interface DriverProviderpublic void setWebDriverView(org.openqa.selenium.android.library.WebDriverView view)
setWebDriverView in interface ViewProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||