org.openqa.selenium.remote.UselessFileDetector Java Examples

The following examples show how to use org.openqa.selenium.remote.UselessFileDetector. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AppPage.java    From teammates with GNU General Public License v2.0 5 votes vote down vote up
protected void fillFileBox(RemoteWebElement fileBoxElement, String fileName) {
    if (fileName.isEmpty()) {
        fileBoxElement.clear();
    } else {
        fileBoxElement.setFileDetector(new UselessFileDetector());
        String filePath = new File(fileName).getAbsolutePath();
        fileBoxElement.sendKeys(filePath);
    }
}
 
Example #2
Source File: AppPage.java    From teammates with GNU General Public License v2.0 5 votes vote down vote up
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);
    }
}
 
Example #3
Source File: RemoteDriverFactory.java    From hsac-fitnesse-fixtures with Apache License 2.0 5 votes vote down vote up
@Override
public T createDriver() {
    if (capabilities instanceof MutableCapabilities) {
        DriverFactory.addDefaultCapabilities((MutableCapabilities) capabilities);
    }
    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;
}
 
Example #4
Source File: RemoteDriverConfigTest.java    From jmeter-plugins-webdriver with Apache License 2.0 4 votes vote down vote up
@Test
public void shouldProduceUselessFileLocator() {
    config.setFileDetectorOption(FileDetectorOption.USELESS);
    assertTrue(config.createFileDetector() instanceof UselessFileDetector);
}