本文整理汇总了Java中com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium类的典型用法代码示例。如果您正苦于以下问题:Java WebDriverBackedSelenium类的具体用法?Java WebDriverBackedSelenium怎么用?Java WebDriverBackedSelenium使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebDriverBackedSelenium类属于com.thoughtworks.selenium.webdriven包,在下文中一共展示了WebDriverBackedSelenium类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildWebDriverInstance
import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium; //导入依赖的package包/类
/**
* By using the default URL, creates a WebDriver object and Selenium object as well.
*
* @param baseUrl is the default URL for the browser, must not be null!
* @return withthe new WebDriver object
*/
public WebDriver buildWebDriverInstance(final String baseUrl) {
if (browserString == null) {
throw new SimpleGepardException("No browser to be used was specified.");
}
DesiredCapabilities capabilities = detectCapabilities();
try {
webDriver = new RemoteWebDriver(buildWebDriverUrl(), capabilities);
selenium = new WebDriverBackedSelenium(webDriver, baseUrl);
selenium.setTimeout(DEFAULT_TIMEOUT); //set the default timeout
} catch (WebDriverException | SeleniumException e) {
throw new SimpleGepardException(e.getLocalizedMessage());
}
// hide all open windows on Mac, it is necessary to hide 'always on top' windows, otherwise useless screenshots will be created from desktop
if (getBrowserType() == BrowserEnum.Safari) {
selenium.keyPressNative(String.valueOf(KeyEvent.VK_F11));
}
return webDriver;
}
示例2: getWebDriverBackedSelenium
import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium; //导入依赖的package包/类
protected WebDriverBackedSelenium getWebDriverBackedSelenium() {
if (this._selenium == null) {
this._selenium = new WebDriverBackedSelenium(getDriver(),
"https://translate.google.com/");
this._selenium.open("/#" + _from + "/" + _to + "/");
}
return this._selenium;
}
示例3: selenium
import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium; //导入依赖的package包/类
/**
* Selenium bean
* @param driver WebDriver
* @param baseUrl Url of web app
* @return Selenium
*/
@Bean
@Lazy(true)
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public Selenium selenium(WebDriver driver, String baseUrl){
return new WebDriverBackedSelenium(driver, baseUrl);
}
示例4: setUp
import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
WebDriver driver = new FirefoxDriver();
String baseUrl = "https://www.google.com.ar/";
selenium = new WebDriverBackedSelenium(driver, baseUrl);
}