当前位置: 首页>>代码示例>>Java>>正文


Java DesiredCapabilities.setPlatform方法代码示例

本文整理汇总了Java中org.openqa.selenium.remote.DesiredCapabilities.setPlatform方法的典型用法代码示例。如果您正苦于以下问题:Java DesiredCapabilities.setPlatform方法的具体用法?Java DesiredCapabilities.setPlatform怎么用?Java DesiredCapabilities.setPlatform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openqa.selenium.remote.DesiredCapabilities的用法示例。


在下文中一共展示了DesiredCapabilities.setPlatform方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: defaultConfiguration

import org.openqa.selenium.remote.DesiredCapabilities; //导入方法依赖的package包/类
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;
}
 
开发者ID:sskorol,项目名称:webdriver-supplier,代码行数:8,代码来源:Browser.java

示例2: setUpClass

import org.openqa.selenium.remote.DesiredCapabilities; //导入方法依赖的package包/类
@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();
}
 
开发者ID:endless-qa,项目名称:webdriver-examples-java,代码行数:11,代码来源:RemoteTestsExample.java

示例3: instantiateWebDriver

import org.openqa.selenium.remote.DesiredCapabilities; //导入方法依赖的package包/类
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 );
    }
}
 
开发者ID:hemano,项目名称:cucumber-framework-java,代码行数:34,代码来源:WebDriverThread.java

示例4: create

import org.openqa.selenium.remote.DesiredCapabilities; //导入方法依赖的package包/类
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);
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:10,代码来源:WebDriverFactory.java

示例5: createDesiredCapabilities

import org.openqa.selenium.remote.DesiredCapabilities; //导入方法依赖的package包/类
@Override
protected DesiredCapabilities createDesiredCapabilities(Description description) {
    DesiredCapabilities desiredCapabilities = super.createDesiredCapabilities(description);
    desiredCapabilities.setPlatform(getPlatform());
    return desiredCapabilities;
}
 
开发者ID:willhaben,项目名称:willtest,代码行数:7,代码来源:SeleniumHubFirefoxProvider.java


注:本文中的org.openqa.selenium.remote.DesiredCapabilities.setPlatform方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。