當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。