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


Java DriverService.getUrl方法代码示例

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


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

示例1: createWebDriver

import org.openqa.selenium.remote.service.DriverService; //导入方法依赖的package包/类
public WebDriverEx createWebDriver(DriverService driverService,
                                      DesiredCapabilities desiredCapabilities,
                                      SiteConfig siteConfig,
                                      DriverConfig driverConfig) throws IOException {
    driverService.start();

    //自定义HttpClientFactory用于设置命令超时时间
    ApacheHttpClient.Factory httpClientFactory = createHttpClientFactory(siteConfig, driverConfig);
    HttpCommandExecutor httpCommandExecutor = new HttpCommandExecutor(
            ImmutableMap.<String, CommandInfo>of(), driverService.getUrl(), httpClientFactory);
    WebDriverEx webDriver = new WebDriverEx(httpCommandExecutor, desiredCapabilities);
    webDriver.setDriverService(driverService);
    webDriver.setCreatedTime(new Date());

    webDriver.manage().timeouts().implicitlyWait(driverConfig.getImplicitlyWait(), TimeUnit.MILLISECONDS);
    webDriver.manage().timeouts().pageLoadTimeout(driverConfig.getPageLoadTimeout(), TimeUnit.MILLISECONDS);
    webDriver.manage().timeouts().setScriptTimeout(driverConfig.getScriptTimeout(), TimeUnit.MILLISECONDS);

    return webDriver;
}
 
开发者ID:brucezee,项目名称:jspider,代码行数:21,代码来源:WebDriverFactory.java

示例2: getDriver

import org.openqa.selenium.remote.service.DriverService; //导入方法依赖的package包/类
/**
 * Gets a web driver for a given browser
 * @param browser The browser to get a driver for
 * @return
 * @throws IOException
 */
public static synchronized RemoteWebDriver getDriver(Browser browser) throws IOException {
    if (global == null) {
        DriverService service = start(browser);
        global = new RemoteWebDriver(service.getUrl(), getDesiredBrowserCapabilities(browser));
        drivers.put(global, service);
    }
    return global;
}
 
开发者ID:Comcast,项目名称:dawg,代码行数:15,代码来源:BrowserServiceManager.java

示例3: create

import org.openqa.selenium.remote.service.DriverService; //导入方法依赖的package包/类
@Override
public WebDriver create(WebDriverFactory webDriverFactory, DesiredCapabilities desiredCapabilities) {
    ChromeDriverServiceProperties serviceProperties = webDriverFactory.driverServices == null ? null : webDriverFactory.driverServices.getChrome();
    DriverService driverService = serviceProperties == null ? null : serviceProperties.getDriverService();
    return driverService == null ?
            new ChromeDriver(new ChromeOptions().merge(desiredCapabilities))
            : new RemoteWebDriver(driverService.getUrl(), desiredCapabilities);
}
 
开发者ID:viltgroup,项目名称:minium,代码行数:9,代码来源:WebDriverFactory.java

示例4: AppiumCommandExecutor

import org.openqa.selenium.remote.service.DriverService; //导入方法依赖的package包/类
public AppiumCommandExecutor(Map<String, CommandInfo> additionalCommands, DriverService service,
    HttpClient.Factory httpClientFactory) {
    super(additionalCommands, service.getUrl(), httpClientFactory);
    this.service = service;
}
 
开发者ID:JoeUtt,项目名称:menggeqa,代码行数:6,代码来源:AppiumCommandExecutor.java


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