DecoratedWebDriver extends DecoratedTopmost<WebDriver> implements WebDriver, WrapsDriver, JavascriptExecutor, HasInputDevices, HasTouchScreen, Interactive { @Override public WebElement findElement(final By by) { return createDecorated(getOriginal().findElement(by)).getActivated(); } DecoratedWebDriver(WebDriver driver); @Override final WebDriver getWrappedDriver(); @Override void get(String url); @Override String getCurrentUrl(); @Override String getTitle(); @Override WebElement findElement(final By by); @Override List<WebElement> findElements(final By by); @Override String getPageSource(); @Override void close(); @Override void quit(); @Override Set<String> getWindowHandles(); @Override String getWindowHandle(); @Override TargetLocator switchTo(); @Override Navigation navigate(); @Override Options manage(); @Override Object executeScript(String script, Object... args); @Override Object executeAsyncScript(String script, Object... args); @Override Keyboard getKeyboard(); @Override Mouse getMouse(); @Override TouchScreen getTouch(); @Override void perform(Collection<Sequence> actions); @Override void resetInputState();  }
@Test void testFindElement() { final WebElement found = mock(WebElement.class); verifyDecoratingFunction($ -> $.findElement(By.id("test")), found, WebElement::click); }