List of usage examples for org.openqa.selenium.remote RemoteWebDriver RemoteWebDriver
public RemoteWebDriver(Capabilities capabilities)
From source file:com.cloudbees.test.SeleniumTest.java
License:Apache License
private void testSeleniumRemoteWebDriver(DesiredCapabilities desiredCapabilities) { System.err.println(""); System.err.println("#############################"); System.err.println("# INSTANTIATE RemoteWebDriver (" + desiredCapabilities + ")"); System.err.println("#############################"); WebDriver webDriver = new RemoteWebDriver(desiredCapabilities); testSeleniumDriver(webDriver);//from ww w. j av a 2 s. com }
From source file:com.sebuilder.interpreter.webdriverfactory.Remote.java
License:Apache License
/** * @param config Key/value pairs treated as required capabilities, with the exception of: * <ul>//from w w w .j a v a2s. c o m * <li>url: Remote URL to connect to.</li> * </ul> * @return A RemoteWebDriver. */ @Override public RemoteWebDriver make(HashMap<String, String> config) throws MalformedURLException { URL url = config.containsKey("url") ? new URL(config.get("url")) : null; HashMap<String, String> caps = new HashMap<String, String>(config); caps.remove("url"); return url == null ? new RemoteWebDriver(new DesiredCapabilities(caps)) : new RemoteWebDriver(url, new DesiredCapabilities(caps)); }
From source file:org.jboss.arquillian.drone.webdriver.augmentation.TestAugmentingEnhancer.java
License:Apache License
@Test public void testCanEnhance() { RemoteWebDriver remoteDriver = new RemoteWebDriver(new DesiredCapabilities()); RemoteWebDriver mockedRemoteDriver = mock(RemoteWebDriver.class); DroneAugmented augmentedDriver = mock(DroneAugmented.class); InstanceOrCallableInstance instance1 = mock(InstanceOrCallableInstance.class); InstanceOrCallableInstance instance2 = mock(InstanceOrCallableInstance.class); InstanceOrCallableInstance instance3 = mock(InstanceOrCallableInstance.class); InstanceOrCallableInstance instance4 = mock(InstanceOrCallableInstance.class); doReturn(remoteDriver).when(instance1).asInstance(RemoteWebDriver.class); doReturn(remoteDriver).when(instance1).asInstance(WebDriver.class); doReturn(augmentedDriver).when(instance1).asInstance(ReusableRemoteWebDriver.class); doReturn(new FirefoxDriver()).when(instance2).asInstance(WebDriver.class); doReturn(mockedRemoteDriver).when(instance3).asInstance(WebDriver.class); doReturn(augmentedDriver).when(instance4).asInstance(WebDriver.class); assertTrue("AugmentingEnhancer should enhance when droneType == RemoteWebDriver.class", enhancer.canEnhance(instance1, RemoteWebDriver.class, Default.class)); assertTrue("AugmentingEnhancer should enhance when droneType == ReusableRemoteWebDriver.class", enhancer.canEnhance(instance1, ReusableRemoteWebDriver.class, Default.class)); assertTrue("AugmentingEnhancer should enhance when real instance is RemoteWebDriver", enhancer.canEnhance(instance1, WebDriver.class, Default.class)); assertTrue("AugmentingEnhancer should enhance when real instance already augmented!", enhancer.canEnhance(instance4, WebDriver.class, Default.class)); assertFalse(//ww w . ja va2s . c om "AugmentingEnhancer should not enhance when real instance is not RemoteWebDriver || ReusableRemoteWebDriver", enhancer.canEnhance(instance2, WebDriver.class, Default.class)); assertFalse("AugmentingEnhancer should not enhance extensions of supported classes!", enhancer.canEnhance(instance3, WebDriver.class, Default.class)); }
From source file:org.senchalabs.gwt.gwtdriver.gxt.models.BaseTest.java
License:Apache License
@Before public void startBrowser() { String url = System.getProperty("webdriver.remote.server"); Capabilities c = DesiredCapabilities.chrome(); driver = new RemoteWebDriver(c); // driver = new FirefoxDriver(); driver.manage().timeouts().setScriptTimeout(1000, TimeUnit.MILLISECONDS); driver.get("http://" + new NetworkUtils().getNonLoopbackAddressOfThisMachine() + ":9080/app/index.html?" + getScenarioName());/*from w ww. jav a2s . c o m*/ }
From source file:se.claremont.SandBoxTest.java
@Ignore @Test/*from www . j a v a 2 s .c o m*/ public void recursiveLinkCheckerTest() throws MalformedURLException { System.setProperty("webdriver.gecko.driver", "C:\\Temp\\geckodriver.exe"); System.setProperty("webdriver.edge.driver", "C:\\Temp\\MicrosoftWebDriver.exe"); //WebDriver webDriver = new FirefoxDriver(); DesiredCapabilities dc = DesiredCapabilities.edge(); WebDriver driver = new RemoteWebDriver(dc); WebInteractionMethods web = new WebInteractionMethods(currentTestCase, driver); web.navigate("http://www.claremont.se"); web.reportBrokenLinks(); web.makeSureDriverIsClosed(); }