org.openqa.selenium.android.library
Class ViewClientWrapper

java.lang.Object
  extended by org.openqa.selenium.android.library.ViewClientWrapper
All Implemented Interfaces:
DriverProvider

public class ViewClientWrapper
extends Object
implements DriverProvider

This class wraps a view client that must have the *same* API as WebViewClient. The underlying client will be used by WebDriver to listen to interesting events on the page.

Sample usage: // If the underlying view is a WebView you can use WebDriver's default // view client DefaultViewClient as follow. ViewClientWrapper viewWrapper = new ViewClientWrapper( "android.webkit.WebViewClient", new DefaultViewClient()); // If the underlying view is a WebView and it has custom WebViewClient // settings, use the DefaultViewClient as follow: class MyCustomClient extends WebViewClient { ... } MyCustomClient myClient = new MyCustomClient(); ViewClientWrapper viewWrapper = new ViewClientWrapper( "android.webkit.WebViewClient", new DefaultViewClient(myClient));


Constructor Summary
ViewClientWrapper(String className, Object client)
           
 
Method Summary
 void setDriver(AndroidWebDriver driver)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewClientWrapper

public ViewClientWrapper(String className,
                         Object client)
Parameters:
className - the fully qualified class name of the client's class name.
client - the client to use. Typically this client will be a WebViewClient (or extend the latter). If not this client must have the same API as WebViewClient. Additionally this client view must implement the DriverProvider interface.
Method Detail

setDriver

public void setDriver(AndroidWebDriver driver)
Specified by:
setDriver in interface DriverProvider


Copyright © 2013. All Rights Reserved.