@SuppressWarnings("unchecked") private List<WebElement> retrieveListFromFactory(ElementLocatorFactory factory) { InvocationHandler handler = new LocatingElementListHandler( ((ScopedElementLocatorFactory) factory).getCurrentScope()); return (List<WebElement>) Proxy .newProxyInstance(WebElement.class.getClassLoader(), new Class[] {List.class}, handler); }