Package org.openqa.selenium.remote

Examples of org.openqa.selenium.remote.DesiredCapabilities


      JSONArray supportedApps = status.getJSONObject("value").getJSONArray("supportedApps");

      JsonToBeanConverter convertor = new JsonToBeanConverter();
      for (int i = 0; i < supportedApps.length(); i++) {
        Capabilities cap = convertor.convert(Capabilities.class, supportedApps.getJSONObject(i));
        capabilities.add(new DesiredCapabilities(cap));
      }
      return capabilities;
    } catch (Exception e) {
      return null;
    }
View Full Code Here


     * @see org.jboss.arquillian.drone.spi.Instantiator#createInstance(org.jboss.arquillian.drone.spi.DroneConfiguration)
     */
    @Override
    public FirefoxDriver createInstance(WebDriverConfiguration configuration) {

        DesiredCapabilities capabilities = new DesiredCapabilities(configuration.getCapabilities());

        String binary = (String) configuration.getCapabilities().getCapability(FirefoxDriver.BINARY);
        String profile = (String) configuration.getCapabilities().getCapability(FirefoxDriver.PROFILE);

        // verify binary and profile values
        if (Validate.nonEmpty(binary)) {
            Validate.isExecutable(binary, "Firefox binary does not point to a valid executable,  " + binary);
        }
        if (Validate.nonEmpty(profile)) {
            Validate.isValidPath(profile, "Firefox profile does not point to a valid path " + profile);
        }

        FirefoxProfile firefoxProfile = new FirefoxProfile();
        capabilities.setCapability(FirefoxDriver.PROFILE, firefoxProfile);

        final String firefoxExtensions = (String) capabilities.getCapability("firefoxExtensions");
        // no check is needed here, it will return empty array if null
        for (String extensionPath : StringUtils.tokenize(firefoxExtensions)) {
            try {
                firefoxProfile.addExtension(new File(extensionPath));
            } catch (IOException e) {
View Full Code Here

        }

        Validate.isEmpty(configuration.getBrowserCapabilities(), "The browser capabilities are not set.");

        // construct capabilities
        DesiredCapabilities desiredCapabilities = new DesiredCapabilities(configuration.getCapabilities());

        RemoteWebDriver driver = null;

        if (configuration.isRemoteReusable()) {
            driver = createReusableDriver(remoteAddress, desiredCapabilities);
View Full Code Here

     */
    @Override
    public PhantomJSDriver createInstance(WebDriverConfiguration configuration) {

        // set capabilities
        DesiredCapabilities capabilities = new DesiredCapabilities(configuration.getCapabilities());

        String driverBinary = (String) capabilities.getCapability(PHANTOMJS_DRIVER_BINARY_KEY);

        if (Validate.empty(driverBinary)) {
            driverBinary = SecurityActions.getProperty(PHANTOMJS_DRIVER_BINARY_KEY);
        }

View Full Code Here

    }

    public Capabilities getCapabilities() {
        // return a merge of original capability plus capabilities user has specified in configuration
        // safely ignore null value here
        return new DesiredCapabilities(new DesiredCapabilities(
                _browserCapabilities.getRawCapabilities() == null ? new HashMap<String, Object>()
                        : _browserCapabilities.getRawCapabilities()),
                new DesiredCapabilities(this.capabilityMap));
    }
View Full Code Here

     */
    @Override
    public ChromeDriver createInstance(WebDriverConfiguration configuration) {

        // set capabilities
        DesiredCapabilities capabilities = new DesiredCapabilities(configuration.getCapabilities());

        String driverBinary = configuration.getChromeDriverBinary();
        String binary = (String) capabilities.getCapability("chrome.binary");
        String chromeSwitches = (String) capabilities.getCapability("chrome.switches");

        if (Validate.empty(driverBinary)) {
            driverBinary = SecurityActions.getProperty(CHROME_DRIVER_BINARY_KEY);
        }

        // driver binary configuration
        // this is setting system property
        if (Validate.nonEmpty(driverBinary)) {
            Validate.isExecutable(driverBinary, "Chrome driver binary must point to an executable file, " + driverBinary);
            SecurityActions.setProperty(CHROME_DRIVER_BINARY_KEY, driverBinary);
        }

        // verify binary capabilities
        if (Validate.nonEmpty(binary)) {
            Validate.isExecutable(binary, "Chrome binary must point to an executable file, " + binary);
        }

        // convert chrome switches to an array of strings
        if (Validate.nonEmpty(chromeSwitches)) {
            capabilities.setCapability("chrome.switches", getChromeSwitches(chromeSwitches));
        }

        // FIXME this call will not be supported for a long time
        // Chrome will be using ChromeOptions object
        return SecurityActions.newInstance(configuration.getImplementationClass(), new Class<?>[] { Capabilities.class },
View Full Code Here

public class HtmlUnitDriverConfig extends WebDriverConfig<HtmlUnitDriver> {

    private static final long serialVersionUID = 100L;

    Capabilities createCapabilities() {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(CapabilityType.PROXY, createProxy());
        capabilities.setCapability("javascriptEnabled", "true");
        return capabilities;
    }
View Full Code Here

    private static final Logger LOGGER = LoggingManager.getLoggerForClass();

    private static final String ANDROID_DRIVER_HOST_PORT = "AndroidDriverConfig.driver_host_port";

    DesiredCapabilities createCapabilities() {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(CapabilityType.PROXY, createProxy());
        return capabilities;
    }
View Full Code Here

    public String getChromeDriverPath() {
        return getPropertyAsString(CHROME_SERVICE_PATH);
    }

    Capabilities createCapabilities() {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(CapabilityType.PROXY, createProxy());
        return capabilities;
    }
View Full Code Here

    private static final String GENERAL_USERAGENT_OVERRIDE = "FirefoxDriverConfig.general.useragent.override";
    private static final String ENABLE_USERAGENT_OVERRIDE = "FirefoxDriverConfig.general.useragent.override.enabled";
    private boolean userAgentOverridden;

    Capabilities createCapabilities() {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(CapabilityType.PROXY, createProxy());
        return capabilities;
    }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.remote.DesiredCapabilities

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.