protected void fillFileBox(RemoteWebElement fileBoxElement, String fileName) { if (fileName.isEmpty()) { fileBoxElement.clear(); } else { fileBoxElement.setFileDetector(new UselessFileDetector()); String newFilePath = new File(fileName).getAbsolutePath(); fileBoxElement.sendKeys(newFilePath); } }
@Override public T createDriver() { T remoteWebDriver = constr.apply(url, capabilities); FileDetector fd = remoteWebDriver.getFileDetector(); if (fd == null || fd instanceof UselessFileDetector) { remoteWebDriver.setFileDetector(new LocalFileDetector()); } Environment.getInstance().setSymbol(REMOTE_URL_KEY, url.toString()); return remoteWebDriver; }