Package org.openqa.selenium.remote

Examples of org.openqa.selenium.remote.RemoteWebDriver.findElement()


public class Selenium2Test extends TestCase {
    public void testFoo() throws Exception {
        WebDriver wd = new RemoteWebDriver(new URL("http://127.0.0.1:4444/wd/hub"), DesiredCapabilities.firefox());
        try {
            wd.get("http://www.yahoo.com/");
            wd.findElement(By.name("p")).sendKeys("hello world");
            wd.findElement(By.id("search-submit")).click();
//        wd.waitForPageToLoad("10000");

            assertTrue(wd.getTitle().contains("hello world"));
            assertTrue(wd.getTitle().contains("Yahoo"));
View Full Code Here


    public void testFoo() throws Exception {
        WebDriver wd = new RemoteWebDriver(new URL("http://127.0.0.1:4444/wd/hub"), DesiredCapabilities.firefox());
        try {
            wd.get("http://www.yahoo.com/");
            wd.findElement(By.name("p")).sendKeys("hello world");
            wd.findElement(By.id("search-submit")).click();
//        wd.waitForPageToLoad("10000");

            assertTrue(wd.getTitle().contains("hello world"));
            assertTrue(wd.getTitle().contains("Yahoo"));
        } finally {
View Full Code Here

    RemoteWebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), cap);
    try {

      driver.manage().timeouts().implicitlyWait(45, TimeUnit.SECONDS);

      WebElement agree = driver.findElement(By.name("Agree"));
      agree.click();

      //driver.switchTo().alert().dismiss();
      WebElement signInButton = driver.findElement(By.xpath("//UIAButton[@name='Sign In']"));
      signInButton.click();
View Full Code Here

      WebElement agree = driver.findElement(By.name("Agree"));
      agree.click();

      //driver.switchTo().alert().dismiss();
      WebElement signInButton = driver.findElement(By.xpath("//UIAButton[@name='Sign In']"));
      signInButton.click();
      WebElement user = driver.findElement(By.xpath("//UIATextField[@value='User ID or email']"));
      user.sendKeys(userId);
      WebElement pass = driver.findElement(By.xpath("//UIASecureTextField[@value='Password']"));
      pass.sendKeys(password);
View Full Code Here

      agree.click();

      //driver.switchTo().alert().dismiss();
      WebElement signInButton = driver.findElement(By.xpath("//UIAButton[@name='Sign In']"));
      signInButton.click();
      WebElement user = driver.findElement(By.xpath("//UIATextField[@value='User ID or email']"));
      user.sendKeys(userId);
      WebElement pass = driver.findElement(By.xpath("//UIASecureTextField[@value='Password']"));
      pass.sendKeys(password);
      WebElement element4 = driver.findElement(By.xpath("//UIAButton[@name='Done']"));
      element4.click();
View Full Code Here

      //driver.switchTo().alert().dismiss();
      WebElement signInButton = driver.findElement(By.xpath("//UIAButton[@name='Sign In']"));
      signInButton.click();
      WebElement user = driver.findElement(By.xpath("//UIATextField[@value='User ID or email']"));
      user.sendKeys(userId);
      WebElement pass = driver.findElement(By.xpath("//UIASecureTextField[@value='Password']"));
      pass.sendKeys(password);
      WebElement element4 = driver.findElement(By.xpath("//UIAButton[@name='Done']"));
      element4.click();

      Thread.sleep(2000);
View Full Code Here

      signInButton.click();
      WebElement user = driver.findElement(By.xpath("//UIATextField[@value='User ID or email']"));
      user.sendKeys(userId);
      WebElement pass = driver.findElement(By.xpath("//UIASecureTextField[@value='Password']"));
      pass.sendKeys(password);
      WebElement element4 = driver.findElement(By.xpath("//UIAButton[@name='Done']"));
      element4.click();

      Thread.sleep(2000);
      boolean cartDown = false;
      // navigate
View Full Code Here

      Thread.sleep(2000);
      boolean cartDown = false;
      // navigate
      String itemId = "220003725262";
      if (cartDown) {
        WebElement search = driver.findElement(By.xpath("//UIAButton[@name='Search']"));
        search.click();

        //validate
        WebElement
            element1 =
View Full Code Here

        search.click();

        //validate
        WebElement
            element1 =
            driver.findElement(By.xpath("//UIASearchBar[@value='Search Watching']"));
        element1.sendKeys(itemId);

        // check it's there.
        WebElement result = driver.findElement(By.className("UIATableCell"));
        System.out.println(result.getAttribute("name"));
View Full Code Here

            element1 =
            driver.findElement(By.xpath("//UIASearchBar[@value='Search Watching']"));
        element1.sendKeys(itemId);

        // check it's there.
        WebElement result = driver.findElement(By.className("UIATableCell"));
        System.out.println(result.getAttribute("name"));

      } else {
        WebElement basket = driver.findElement(By.xpath("//UIAButton[@name='Basket, 1 item']"));
        //By.xpath("//UIAButton[matches(@name,l10n('ItemCountFormatStringPlural'))]"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.