Package io.appium.java_client.proxy
Class ElementAwareWebDriverListener
java.lang.Object
io.appium.java_client.proxy.ElementAwareWebDriverListener
- All Implemented Interfaces:
MethodCallListener,ProxyAwareListener
public class ElementAwareWebDriverListener
extends Object
implements MethodCallListener, ProxyAwareListener
-
Field Summary
Fields inherited from interface io.appium.java_client.proxy.MethodCallListener
UNSET -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.appium.java_client.proxy.MethodCallListener
afterCall, beforeCall, onError
-
Constructor Details
-
ElementAwareWebDriverListener
public ElementAwareWebDriverListener()
-
-
Method Details
-
attachProxyInstance
Attaches the WebDriver proxy instance to this listener.The listener stores the WebDriver instance to associate it as parent to RemoteWebElement proxies.
- Specified by:
attachProxyInstancein interfaceProxyAwareListener- Parameters:
proxy- A proxy instance ofWebDriver.
-
call
Intercepts method calls on a proxied WebDriver.If the result of the method call is a
RemoteWebElement, it is wrapped with a proxy to allow further interception of RemoteWebElement method calls. If the result is a list, each item is checked, and all RemoteWebElements are individually proxied. All other return types are passed through unmodified. Avoid overriding this method, it will alter the behaviour of the listener.- Specified by:
callin interfaceMethodCallListener- Parameters:
obj- The object on which the method was invoked.method- The method being invoked.args- The arguments passed to the method.original- ACallablethat represents the original method execution.- Returns:
- The (possibly wrapped) result of the method call.
- Throws:
Throwable- if the original method or any wrapping logic throws an exception.
-