Search in sources :

Example 11 with WebDriverCapability

use of com.testsigma.automator.drivers.WebDriverCapability in project testsigma by testsigmahq.

the class ChromeDriver method setBrowserSpecificCapabilities.

@Override
protected void setBrowserSpecificCapabilities(List<WebDriverCapability> additionalCapabilitiesList) throws AutomatorException {
    if (additionalCapabilitiesList != null) {
        for (Iterator<WebDriverCapability> single = additionalCapabilitiesList.listIterator(); single.hasNext(); ) {
            WebDriverCapability singleCap = single.next();
            String name = singleCap.getCapabilityName();
            if (ChromeOptions.CAPABILITY.equals(name)) {
                String values = singleCap.getCapabilityValue().toString();
                Map<String, Object> option = parseCapabilities(values, "ChromeOptions");
                if (option.get("args") != null) {
                    List<Object> list = (List<Object>) option.get("args");
                    for (Object str : list) {
                        chromeOptions.addArguments(str.toString());
                    }
                }
                if (option.get("extensions") != null) {
                    List<Object> list = (List<Object>) option.get("extensions");
                    for (Object str : list) {
                        chromeOptions.addExtensions(new File(str.toString()));
                    }
                }
                if (option.get("mobileEmulation") != null) {
                    Map<String, Object> mobileEmulation = (Map<String, Object>) option.get("mobileEmulation");
                    chromeOptions.setExperimentalOption("mobileEmulation", mobileEmulation);
                }
                if (option.get("prefs") != null) {
                    Map<String, Object> prefs = (Map<String, Object>) option.get("prefs");
                    chromeOptions.setExperimentalOption("prefs", prefs);
                }
                if (option.get("binary") != null) {
                    List<Object> list = (List<Object>) option.get("binary");
                    for (Object str : list) {
                        chromeOptions.setBinary(str.toString());
                    }
                }
                single.remove();
            }
        }
    }
}
Also used : WebDriverCapability(com.testsigma.automator.drivers.WebDriverCapability) List(java.util.List) File(java.io.File) Map(java.util.Map)

Example 12 with WebDriverCapability

use of com.testsigma.automator.drivers.WebDriverCapability in project testsigma by testsigmahq.

the class FirefoxDriver method setAdditionalCapabilities.

protected void setAdditionalCapabilities(List<WebDriverCapability> additionalCapabilitiesList) {
    if (additionalCapabilitiesList != null) {
        for (WebDriverCapability capability : additionalCapabilitiesList) {
            String name = capability.getCapabilityName();
            capabilities.add(new WebDriverCapability(name, capability.getCapabilityValue()));
        }
    }
}
Also used : WebDriverCapability(com.testsigma.automator.drivers.WebDriverCapability)

Example 13 with WebDriverCapability

use of com.testsigma.automator.drivers.WebDriverCapability in project testsigma by testsigmahq.

the class WebDriver method checkForLocationCapability.

protected void checkForLocationCapability(List<WebDriverCapability> additionalCapabilitiesList) {
    if (additionalCapabilitiesList != null) {
        for (Iterator<WebDriverCapability> single = additionalCapabilitiesList.listIterator(); single.hasNext(); ) {
            WebDriverCapability capability = single.next();
            String name = capability.getCapabilityName();
            if (com.testsigma.automator.constants.DesiredCapabilities.GEOLOCATION.equals(name)) {
                single.remove();
                locationCapability = new WebDriverCapability(name, capability.getCapabilityValue());
            }
        }
    }
}
Also used : WebDriverCapability(com.testsigma.automator.drivers.WebDriverCapability)

Example 14 with WebDriverCapability

use of com.testsigma.automator.drivers.WebDriverCapability in project testsigma by testsigmahq.

the class AndroidWebDriver method setHybridCapabilities.

@Override
protected void setHybridCapabilities() throws AutomatorException, MalformedURLException {
    super.setHybridCapabilities();
    ChromeOptions options = new ChromeOptions();
    options.setExperimentalOption("w3c", false);
    capabilities.add(new WebDriverCapability("nativeWebScreenshot", Boolean.TRUE));
    if (settings.getChromedriverExecutableDir() != null) {
        capabilities.add(new WebDriverCapability(TSCapabilityType.CHROME_DRIVER_EXECUTABLE_DIR, settings.getChromedriverExecutableDir()));
    }
    capabilities.add(new WebDriverCapability(ChromeOptions.CAPABILITY, options));
    capabilities.add(new WebDriverCapability(AndroidMobileCapabilityType.UNICODE_KEYBOARD, Boolean.TRUE));
    capabilities.add(new WebDriverCapability(AndroidMobileCapabilityType.RESET_KEYBOARD, Boolean.TRUE));
}
Also used : WebDriverCapability(com.testsigma.automator.drivers.WebDriverCapability) ChromeOptions(org.openqa.selenium.chrome.ChromeOptions)

Example 15 with WebDriverCapability

use of com.testsigma.automator.drivers.WebDriverCapability in project testsigma by testsigmahq.

the class IosDriver method setCommonCapabilities.

@Override
protected void setCommonCapabilities() throws AutomatorException {
    super.setCommonCapabilities();
    capabilities.add(new WebDriverCapability(MobileCapabilityType.PLATFORM_NAME, Platform.iOS.name()));
}
Also used : WebDriverCapability(com.testsigma.automator.drivers.WebDriverCapability)

Aggregations

WebDriverCapability (com.testsigma.automator.drivers.WebDriverCapability)15 File (java.io.File)2 Map (java.util.Map)2 AgentBrowser (com.testsigma.agent.browsers.AgentBrowser)1 WebDriverSettingsDTO (com.testsigma.agent.dto.WebDriverSettingsDTO)1 TestsigmaDriver (com.testsigma.automator.drivers.TestsigmaDriver)1 AppPathType (com.testsigma.automator.entity.AppPathType)1 AppInstaller (com.testsigma.automator.mobile.ios.AppInstaller)1 URL (java.net.URL)1 List (java.util.List)1 MutableCapabilities (org.openqa.selenium.MutableCapabilities)1 ChromeOptions (org.openqa.selenium.chrome.ChromeOptions)1 FirefoxProfile (org.openqa.selenium.firefox.FirefoxProfile)1 RemoteWebDriver (org.openqa.selenium.remote.RemoteWebDriver)1