Search in sources :

Example 96 with DesiredCapabilities

use of org.openqa.selenium.remote.DesiredCapabilities in project jmeter-plugins by undera.

the class HtmlUnitDriverConfig method createCapabilities.

Capabilities createCapabilities() {
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(CapabilityType.PROXY, createProxy());
    capabilities.setCapability("javascriptEnabled", "true");
    return capabilities;
}
Also used : DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities)

Example 97 with DesiredCapabilities

use of org.openqa.selenium.remote.DesiredCapabilities in project jmeter-plugins by undera.

the class InternetExplorerDriverConfig method createCapabilities.

Capabilities createCapabilities() {
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability(CapabilityType.PROXY, createProxy());
    capabilities.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);
    return capabilities;
}
Also used : DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities)

Example 98 with DesiredCapabilities

use of org.openqa.selenium.remote.DesiredCapabilities in project jmeter-plugins by undera.

the class RemoteDesiredCapabilitiesFactory method build.

public static DesiredCapabilities build(RemoteCapability capability) {
    DesiredCapabilities desiredCapabilities;
    if (RemoteCapability.CHROME.equals(capability)) {
        ChromeOptions options = new ChromeOptions();
        desiredCapabilities = DesiredCapabilities.chrome();
        desiredCapabilities.setCapability(ChromeOptions.CAPABILITY, options);
        return desiredCapabilities;
    } else if (RemoteCapability.FIREFOX.equals(capability)) {
        FirefoxProfile profile = new FirefoxProfile();
        desiredCapabilities = DesiredCapabilities.firefox();
        desiredCapabilities.setCapability(FirefoxDriver.PROFILE, profile);
        return desiredCapabilities;
    } else if (RemoteCapability.INTERNET_EXPLORER.equals(capability)) {
        desiredCapabilities = DesiredCapabilities.internetExplorer();
        return desiredCapabilities;
    } else if (RemoteCapability.PHANTOMJS.equals(capability)) {
        desiredCapabilities = DesiredCapabilities.phantomjs();
        return desiredCapabilities;
    }
    throw new IllegalArgumentException("No such capability");
}
Also used : DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) ChromeOptions(org.openqa.selenium.chrome.ChromeOptions) FirefoxProfile(org.openqa.selenium.firefox.FirefoxProfile)

Example 99 with DesiredCapabilities

use of org.openqa.selenium.remote.DesiredCapabilities in project jmeter-plugins by undera.

the class RemoteDesiredCapabilitiesFactoryTest method shouldReturnInternetExplorerDriverWhenInternetExplorerCapabilityIsPassed.

@Test
public void shouldReturnInternetExplorerDriverWhenInternetExplorerCapabilityIsPassed() throws Exception {
    DesiredCapabilities capabilities = RemoteDesiredCapabilitiesFactory.build(RemoteCapability.INTERNET_EXPLORER);
    assertThat(capabilities.getBrowserName(), is("internet explorer"));
}
Also used : DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) Test(org.junit.Test)

Example 100 with DesiredCapabilities

use of org.openqa.selenium.remote.DesiredCapabilities in project jmeter-plugins by undera.

the class RemoteDesiredCapabilitiesFactoryTest method shouldReturnPhantomJSDriverWhenPhantomJSCapabilityIsPassed.

@Test
public void shouldReturnPhantomJSDriverWhenPhantomJSCapabilityIsPassed() throws Exception {
    DesiredCapabilities capabilities = RemoteDesiredCapabilitiesFactory.build(RemoteCapability.PHANTOMJS);
    assertThat(capabilities.getBrowserName(), is("phantomjs"));
}
Also used : DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) Test(org.junit.Test)

Aggregations

DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)173 File (java.io.File)55 ChromeDriver (org.openqa.selenium.chrome.ChromeDriver)40 HashMap (java.util.HashMap)33 URL (java.net.URL)32 RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)29 ChromeOptions (org.openqa.selenium.chrome.ChromeOptions)28 Test (org.testng.annotations.Test)22 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)20 BeforeClass (org.junit.BeforeClass)19 FirefoxProfile (org.openqa.selenium.firefox.FirefoxProfile)18 TestSetup (com.coveros.selenified.utilities.TestSetup)17 PhantomJSDriver (org.openqa.selenium.phantomjs.PhantomJSDriver)15 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)14 Before (org.junit.Before)13 Test (org.junit.Test)13 MalformedURLException (java.net.MalformedURLException)12 WebDriver (org.openqa.selenium.WebDriver)12 Actions (org.openqa.selenium.interactions.Actions)12 Dimension (org.openqa.selenium.Dimension)11