DriverElement implements Element { public static Element locatorExists(Driver driver, String locator) { return new DriverElement(driver, locator, true); } private  DriverElement(Driver driver, String locator, Boolean exists); static Element locatorExists(Driver driver, String locator); static Element locatorUnknown(Driver driver, String locator); @Override String getLocator(); @Override boolean isPresent(); void setExists(Boolean exists); @Override Map<String, Object> getPosition(); @Override byte[] screenshot(); @Override boolean isEnabled(); @Override Element highlight(); @Override Element focus(); @Override Element clear(); @Override Element click(); @Override Element submit(); @Override Mouse mouse(); @Override Element input(String value); @Override Element input(String[] values); @Override Element input(String[] values, int delay); @Override Element select(String text); @Override Element select(int index); @Override Element switchFrame(); @Override Element delay(int millis); @Override Element retry(); @Override Element retry(int count); @Override Element retry(Integer count, Integer interval); @Override Element waitFor(); @Override Element waitForText(String text); @Override Element waitUntil(String expression); @Override Object script(String expression); @Override Element optional(String locator); @Override boolean exists(String locator); @Override Element locate(String locator); @Override List<Element> locateAll(String locator); @Override String attribute(String name); @Override String property(String name); @Override String getHtml(); @Override void setHtml(String html); @Override String getText(); @Override void setText(String text); @Override String getValue(); @Override void setValue(String value); @Override Element getParent(); @Override List<Element> getChildren(); @Override Element getFirstChild(); @Override Element getLastChild(); @Override Element getPreviousSibling(); @Override Element getNextSibling(); @Override Finder rightOf(); @Override Finder leftOf(); @Override Finder above(); @Override Finder below(); @Override Finder near();  }
@Test public void testToJson() { JsonUtils.toJsonDoc("{}"); Element de = DriverElement.locatorExists(null, "foo"); List list = Collections.singletonList(de); ScriptValue sv = new ScriptValue(list); sv.getAsString(); }