Interface ProxyAwareListener

  • All Superinterfaces:
    MethodCallListener
    All Known Implementing Classes:
    ElementAwareWebDriverListener

    public interface ProxyAwareListener
    extends MethodCallListener
    Extension of MethodCallListener that allows access to the proxy instance it depends on.

    This interface is intended for listeners that need a reference to the proxy object.

    The attachProxyInstance(Object) method will be invoked immediately after the proxy is created, allowing the listener to bind to it before any method interception begins.

    Example usage: Working with elements such as RemoteWebElement that require runtime mutation (e.g. setting parent driver or element ID).

    • Method Detail

      • attachProxyInstance

        void attachProxyInstance​(java.lang.Object proxy)
        Binds the listener to the proxy instance passed.

        This is called once, immediately after proxy creation and before the proxy is returned to the caller.

        Parameters:
        proxy - the proxy instance created via createProxy that this listener is attached to.