Package org.openqa.selenium

Examples of org.openqa.selenium.WebElement.sendKeys()


          // Find the text input element by its name
          WebElement element = driver.findElement(By.name("q"));

          // Enter something to search for
          element.sendKeys("Cheese!");

          // Now submit the form. WebDriver will find the form for us from the element
          element.submit();
         
          //*** return the next page object
View Full Code Here


          // Go to the Google Suggest home page
          driver.get("http://www.google.com/webhp?complete=1&hl=en");
         
          // Enter the query string "Cheese"
          WebElement query = driver.findElement(By.name("q"));
          query.sendKeys("Cheese");

          // Sleep until the div we want is visible or 5 seconds is over
          long end = System.currentTimeMillis() + 5000;
          while (System.currentTimeMillis() < end) {
              WebElement resultsDiv = driver.findElement(By.className("gsq_a"));
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();
View Full Code Here

      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);
      boolean cartDown = false;
View Full Code Here

        //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

      }

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

      driver.findElement(By.cssSelector(".resetter")).click();
      email.sendKeys("ppbuild-1920977828325914@paypal.com");

      WebElement password = driver.findElement(By.id("password"));
      password.sendKeys("11111111");

      WebElement login = driver.findElement(By.id("login"));
View Full Code Here

      driver.findElement(By.cssSelector(".resetter")).click();
      email.sendKeys("ppbuild-1920977828325914@paypal.com");

      WebElement password = driver.findElement(By.id("password"));
      password.sendKeys("11111111");

      WebElement login = driver.findElement(By.id("login"));
      login.click();

      Thread.sleep(30000);
View Full Code Here

    WebElement body = driver.findElement(By.cssSelector("body"));

    driver.get("http://ebay.co.uk");
    WebElement search = driver.findElement(By.id("kw"));

    search.sendKeys("ipod");
    body = driver.findElement(By.cssSelector("body"));
  }

  @Test
  //(enabled = false)
View Full Code Here

      for (Orientation o : getOrientationForDevice(device)) {
        driver.rotate(o);
        driver.get(pages.formPage);
        WebElement element = driver.findElement(By.id("working"));

        element.sendKeys("some");
        String value = element.getAttribute("value");
        assertEquals(value, ("some"));

        element.sendKeys(" text");
        value = element.getAttribute("value");
View Full Code Here

        element.sendKeys("some");
        String value = element.getAttribute("value");
        assertEquals(value, ("some"));

        element.sendKeys(" text");
        value = element.getAttribute("value");
        assertEquals(value, ("some text"));
      }

    } finally {
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.