Java 类org.openqa.selenium.WebDriverBackedSelenium 实例源码

项目:OpenNMS    文件:OpenNMSSeleniumTestCase.java   
@Before
public void setUp() throws Exception {
    MockLogAppender.setupLogging(true, "DEBUG");

    // Google Chrome
    // System.setProperty("webdriver.chrome.driver", "/Users/ranger/Downloads/chromedriver");
    // WebDriver driver = new ChromeDriver();

    // Selenium remote server
    // DesiredCapabilities capability = DesiredCapabilities.firefox();
    // WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);

    // Firefox
    WebDriver driver = new FirefoxDriver();

    String baseUrl = "http://localhost:8980/";
    selenium = new WebDriverBackedSelenium(driver, baseUrl);
    selenium.open("/opennms/login.jsp");
    selenium.type("name=j_username", "admin");
    selenium.type("name=j_password", "admin");
    selenium.click("name=Login");
    waitForPageToLoad();
}
项目:Prospero    文件:WebDriverBackedSeleniumDriver.java   
protected WebDriverBackedSeleniumDriver(WebDriver wd, String url) {
super();
setSiteUrl(url);
Selenium wdbs = new WebDriverBackedSelenium(wd, url);
setSelenium(wdbs);
startSelenium();
   }
项目:crawljax    文件:OverviewIntegrationTest.java   
@BeforeClass
public static void setup() throws Exception {
    LOG.debug("Starting Jetty");
    server = new Server(0);

    String url = setupJetty();
    LOG.info("Jetty started on {}", url);
    driver = new FirefoxDriver();
    LOG.debug("Starting selenium");
    selenium = new WebDriverBackedSelenium(driver, url);

    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
项目:Mahesh.tutorials    文件:WrapperFunctions.java   
/**
 * @param driver
 * @param locator
 */

public void hoverMouseOn(WebDriver driver, String locator) {
    WebDriverBackedSelenium selenium = new WebDriverBackedSelenium(driver,
            driver.getCurrentUrl());
    selenium.mouseOver(locator);
}
项目:selenium-yatspec-petclinic    文件:OwnerPage.java   
public OwnerPage(WebDriverBackedSelenium selenium) {
    super("Owners", selenium, HomePage.PAGE_TITLE);
    if (!selenium.getHtmlSource().contains("Owner Information")) {
        String msg = format("Owner Information page has not been loaded from [%s]", selenium.getLocation());
        throw new NotCorrectPageException(msg);
    }
}
项目:selenium-yatspec-petclinic    文件:AddOwnerPage.java   
public AddOwnerPage(WebDriverBackedSelenium selenium) {
    super("Add Owner", selenium, HomePage.PAGE_TITLE);
    if (!selenium.getHtmlSource().contains(" New  Owner")) {
        String msg = format("Add Owner page has not been loaded from [%s]", selenium.getLocation());
        throw new NotCorrectPageException(msg);
    }
}
项目:selenium-yatspec-petclinic    文件:FindOwnersPage.java   
public FindOwnersPage(WebDriverBackedSelenium selenium) {
    super("Find Owners", selenium, HomePage.PAGE_TITLE);
    if (!selenium.getHtmlSource().contains("Find Owners")) {
        String msg = format("Find Owners page has not been loaded from [%s]", selenium.getLocation());
        throw new NotCorrectPageException(msg);
    }
}
项目:selenium-yatspec-petclinic    文件:HomePage.java   
public HomePage(WebDriverBackedSelenium selenium) {
    super("Home", selenium, PAGE_TITLE);
    if (!selenium.getHtmlSource().contains("Welcome")) {
        String msg = format("Home page has not been loaded from [%s]", selenium.getLocation());
        throw new NotCorrectPageException(msg);
    }
}
项目:selenium-yatspec-petclinic    文件:BasePage.java   
public BasePage(String internalPageName, WebDriverBackedSelenium selenium, String expectedPageText) {
    this.internalPageName = internalPageName;
    this.selenium = selenium;
    String html = getHtml();
    if (!html.contains(expectedPageText)) {
        String msg = format("Page body (%s) does not contain expected text (%s), current page is: %s", html, expectedPageText, selenium.getLocation());
        throw new NotCorrectPageException(msg);
    }
}
项目:EarthWorm    文件:BrowserEmulator.java   
public BrowserEmulator() {
    setupBrowserCoreType(GlobalSettings.browserCoreType);
    browser = new WebDriverBackedSelenium(browserCore, "https://github.com/");
    javaScriptExecutor = (JavascriptExecutor) browserCore;
    logger.info("Started BrowserEmulator");
}
项目:EarthWorm    文件:BrowserEmulator.java   
/**
 * 获取 WebDriverBackedSelenium 实例
 * @return
 */
public WebDriverBackedSelenium getBrowser() {
    return browser;
}