Java 类org.openqa.selenium.remote.UselessFileDetector 实例源码

项目:teammates    文件:AppPage.java   
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);
    }
}
项目:hsac-fitnesse-fixtures    文件:RemoteDriverFactory.java   
@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;
}