Пример #1
0
  @Test
  public void testSendKeys() {
    try {

      // Find sign in button
      ITafElement signInElement = webpage.findObjectById(prop.getProperty("amazon_signin_link"));
      Assert.assertEquals("rgba(0, 102, 192, 1)", signInElement.getCssValue("color"));

      // hover on it
      signInElement.hover();

      // Click on it
      signInElement.click();

      // Find email field
      ITafElement element = webpage.findObjectById(prop.getProperty("amazon_email_field"));

      // enter text
      element.sendKeys("Text");

      Assert.assertEquals("Text", element.getAttribute("value"));
      CommonUtil.sop(element.getAttribute("style"));

      // clear email field
      element.clear();

      Assert.assertEquals("", element.getAttribute("value"));
    } catch (Exception ex) {
      log.error(ex.getMessage());
    }
  }