Created
September 14, 2016 07:08
-
-
Save Toilal/b6a57c526fda9f68ecea7f45b9c19f7f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.fluentlenium.configuration.ConfigurationException; | |
import org.fluentlenium.configuration.WebDriverFactory; | |
import org.openqa.selenium.Capabilities; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.remote.Augmenter; | |
import org.openqa.selenium.remote.RemoteWebDriver; | |
import java.net.MalformedURLException; | |
import java.net.URL; | |
public class AugmenterRemoteWebDriverFactory implements WebDriverFactory { | |
@Override | |
public WebDriver newWebDriver(Capabilities desiredCapabilities) { | |
try { | |
return new Augmenter().augment(new RemoteWebDriver(new URL((String) desiredCapabilities.getCapability("augmenter.hublocation")), desiredCapabilities)); | |
} catch (MalformedURLException e) { | |
throw new ConfigurationException("Can't configure augmenter driver", e); | |
} | |
} | |
@Override | |
public String getName() { | |
return "augmenter"; | |
} | |
@Override | |
public int getPriority() { | |
return 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment