Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package uk.sponte.automation.seleniumpom.proxies.handlers;
 
 import  org.openqa.selenium.By;
 import  org.openqa.selenium.SearchContext;
 import  org.openqa.selenium.WebDriver;
 
Created by swozniak on 03/04/15.
public class WebElementHandler implements InvocationHandler {
    private WebDriver driver;
    private SearchContext searchContext;
    private By by;
    public WebElementHandler(WebDriver driver, SearchContext searchContext, By by) {
        this. = driver;
        this. = searchContext;
        this. = by;
    }
    public Object invoke(Object proxyMethod methodObject[] argsthrows Throwable {
        PageElement element = new PageElementImpl(.findElement(this.));
        try {
            return method.invoke(elementargs);
        } catch(InvocationTargetException ex) {
            throw ex.getCause();
        }
    }
New to GrepCode? Check out our FAQ X