Example usage for org.openqa.selenium WebDriver get

List of usage examples for org.openqa.selenium WebDriver get

Introduction

In this page you can find the example usage for org.openqa.selenium WebDriver get.

Prototype

void get(String url);

Source Link

Document

Load a new web page in the current browser window.

Usage

From source file:org.hepaces.surveyfeedbacktestscript.KrogerFeedbackManager.java

public static void main(String[] args) {
    //test inputs
    DateTime date = new DateTime();
    WebDriver browser = new FirefoxDriver();
    String entryId = "014-695-15-858-88-0a";
    browser.get("https://www.krogerfeedback.com/");

    fillInDateAndTime(date, browser);/*from   ww w  . j a va2 s .c  om*/
    fillInEntryId(entryId, browser);

    clickSubmit(browser);

    System.out.println(getErrorMessage(browser));

    browser.close();
    browser.quit();
}

From source file:org.itracker.selenium.SeleniumPreTest.java

License:Open Source License

@Test
public void testITrackerSiteSelenium() throws Exception {

    org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(getClass());
    log.log("Test", Level.INFO, "TEST", null);
    log.debug("hello");
    WebDriver driver = SeleniumManager.getWebDriver();
    if (logger.isDebugEnabled()) {
        logger.debug("testITrackerSiteSelenium has a webdriver: {}", driver);
    }/*from w  w w  .j  a  v a  2s. co  m*/
    driver.get("http://itracker.sourceforge.net");
    driver.findElement(By.cssSelector("body #banner"));
    driver.findElement(By.cssSelector("body #breadcrumbs"));
    driver.findElement(By.cssSelector("body #leftColumn"));
    driver.findElement(By.cssSelector("body #bodyColumn"));
    driver.findElement(By.cssSelector("body #footer"));

    driver.get("http://itracker.sourceforge.net/license.html");
    final String license = driver.findElement(By.xpath("//h3[a[@name=\"GNU_Lesser_General_Public_License\"]]"))
            .getText();
    Assert.assertEquals("project license", "GNU Lesser General Public License", license);

}

From source file:org.jboss.arquillian.droidium.web.page.LoginWebPage.java

License:Apache License

public void go(WebDriver browser, URL context) {
    browser.get(context.toExternalForm() + "/" + AppConstants.TODO_APP_NAME);
}

From source file:org.jboss.arquillian.drone.example.WebDriverTestCase.java

License:Apache License

@Test
public void testLoginAndLogout(@Drone WebDriver driver) {
    driver.get("http://localhost:8080/weld-login/home.jsf");

    driver.findElement(USERNAME_FIELD).sendKeys(USERNAME);
    driver.findElement(PASSWORD_FIELD).sendKeys(PASSWORD);
    driver.findElement(LOGIN_BUTTON).click();
    checkElementPresence(driver, LOGGED_IN, "User should be logged in!");

    driver.findElement(LOGOUT_BUTTON).click();
    checkElementPresence(driver, LOGGED_OUT, "User should not be logged in!");

}

From source file:org.jboss.arquillian.drone.webdriver.factory.remote.reusable.ftest.TestReusingCookies.java

License:Apache License

@Test
@InSequence(1)// ww w  .ja  v  a 2s .co m
public void testCookieWasNotThere(@Drone @Reusable WebDriver driver) {
    driver.get(HUB_URL.toString());
    Assert.assertNull("Cookie is not there", driver.manage().getCookieNamed("foo"));
}

From source file:org.jboss.arquillian.drone.webdriver.factory.remote.reusable.ftest.TestReusingCookies.java

License:Apache License

@Test
@InSequence(2)//www.j av  a 2 s . c  om
public void testCookieWasStored(@Drone @Reusable WebDriver driver) {
    driver.get(HUB_URL.toString());
    driver.manage().addCookie(new Cookie("foo", "bar"));
    Assert.assertNotNull("Cookie was stored", driver.manage().getCookieNamed("foo"));
    Assert.assertEquals("Cookie was stored", "bar", driver.manage().getCookieNamed("foo").getValue());
}

From source file:org.jboss.arquillian.drone.webdriver.factory.remote.reusable.ftest.TestReusingCookies.java

License:Apache License

@Test
@InSequence(3)/*from   w ww  .  ja  va2s.c  o m*/
public void testCookieWasDeleted(@Drone @Reusable WebDriver driver) {
    driver.get(HUB_URL.toString());
    Assert.assertNull("Cookie is not there", driver.manage().getCookieNamed("foo"));
}

From source file:org.jboss.arquillian.drone.webdriver.factory.remote.reusable.ftest.TestReusingCookies.java

License:Apache License

@Test
@InSequence(4)/*from  w w w  .j  av  a2s.  c  o  m*/
public void testCookieWasNotThereAgain(@Drone @ReuseCookies WebDriver driver) {
    driver.get(HUB_URL.toString());
    Assert.assertNull("Cookie is not there", driver.manage().getCookieNamed("foo"));
}

From source file:org.jboss.arquillian.drone.webdriver.factory.remote.reusable.ftest.TestReusingCookies.java

License:Apache License

@Test
@InSequence(5)/*w  ww .j  ava2  s  .  c  o m*/
public void testCookieWasStoredAgain(@Drone @ReuseCookies WebDriver driver) {
    driver.get(HUB_URL.toString());
    driver.manage().addCookie(new Cookie("foo", "bar"));
    Assert.assertNotNull("Cookie was stored", driver.manage().getCookieNamed("foo"));
    Assert.assertEquals("Cookie was stored", "bar", driver.manage().getCookieNamed("foo").getValue());
}

From source file:org.jboss.arquillian.drone.webdriver.factory.remote.reusable.ftest.TestReusingCookies.java

License:Apache License

@Test
@InSequence(6)//from  w  w w.ja v a  2  s  .  c  o m
public void testCookieWasNotDeleted(@Drone @ReuseCookies WebDriver driver) {
    driver.get(HUB_URL.toString());
    Assert.assertNotNull("Cookie was stored", driver.manage().getCookieNamed("foo"));
    Assert.assertEquals("Cookie was stored", "bar", driver.manage().getCookieNamed("foo").getValue());
}