Java Code Examples for org.openqa.selenium.remote.DesiredCapabilities.setPlatform()

The following are Jave code examples for showing how to use setPlatform() of the org.openqa.selenium.remote.DesiredCapabilities class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: webdriver-supplier   File: Browser.java   View Source Code Vote up 5 votes
default Capabilities defaultConfiguration(final XmlConfig config) {
    final DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setBrowserName(config.getBrowser());
    capabilities.setVersion(config.getVersion());
    capabilities.setPlatform(config.getPlatform());
    return capabilities;
}
 
Example 2
Project: webdriver-examples-java   File: RemoteTestsExample.java   View Source Code Vote up 5 votes
@BeforeClass
@Parameters("browser")
public void setUpClass(Browser browser) throws MalformedURLException {
    DesiredCapabilities dc = new DesiredCapabilities();
    dc.setPlatform(Platform.LINUX);

    driver = BrowserProvider.createDriver(new URL("http://10.200.200.200:4444/wd/hub"), browser);
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    driver.manage().window().maximize();
}
 
Example 3
Project: cucumber-framework-java   File: WebDriverThread.java   View Source Code Vote up 5 votes
private void instantiateWebDriver( DesiredCapabilities desiredCapabilities ) throws MalformedURLException
{

    System.out.println( String.format( "Current Operating System : {%s}"
            , operatingSystem ) );
    System.out.println( String.format( "Current System Architecture : {%s}"
            , systemArchitecture ) );
    System.out.println( String.format( "Current Browser : {%s}\n"
            , driverType ) );

    if( useRemoteWebDriver )
    {
        URL seleniumGridURL = new URL( System.getProperty( "gridURL" ) );
        System.out.println( "seleniumGridURL = " + seleniumGridURL );
        String desiredBrowserVersion = System.getProperty( "desiredBrowserVersion" );
        String desiredPlatform = System.getProperty( "desiredPlatform" );

        if( ( null != desiredPlatform ) && desiredPlatform.isEmpty() )
        {
            desiredCapabilities.setPlatform( Platform.valueOf( desiredPlatform ) );
        }

        if( null != desiredBrowserVersion && desiredBrowserVersion.isEmpty() )
        {
            desiredCapabilities.setVersion( desiredBrowserVersion );
        }
        driver = new RemoteWebDriver( seleniumGridURL, desiredCapabilities );

    } else
    {
        driver = selectedDriverType.getWebDriverObject( desiredCapabilities );
    }
}
 
Example 4
Project: Cognizant-Intelligent-Test-Scripter   File: WebDriverFactory.java   View Source Code Vote up 5 votes
private static WebDriver create(RunContext context, ProjectSettings settings, Boolean isGrid, String remoteUrl) {
    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setPlatform(context.Platform);
    if (!context.BrowserVersion.equalsIgnoreCase("default")) {
        caps.setVersion(context.BrowserVersion);
    }
    caps.merge(getCapability(context.BrowserName, settings));
    return create(context.BrowserName, caps, settings, isGrid, remoteUrl);
}
 
Example 5
Project: willtest   File: SeleniumHubFirefoxProvider.java   View Source Code Vote up 4 votes
@Override
protected DesiredCapabilities createDesiredCapabilities(Description description) {
    DesiredCapabilities desiredCapabilities = super.createDesiredCapabilities(description);
    desiredCapabilities.setPlatform(getPlatform());
    return desiredCapabilities;
}