本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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;
}