Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. waitforelementpresent(locator.login_email);
  2. click(locator.login_email);
  3. type(locator.login_email,email);
  4. click(locator.login_password);
  5. type(locator.login_password,password);
  6. Thread.sleep(5000);
  7. click(locator.login_button); //This button I need to click
  8.  
  9. public static void click(By by) {
  10. WebDriverWait wait = new WebDriverWait(driver, defaultWaitPeriod);
  11.  
  12. wait.until(ExpectedConditions.elementToBeClickable(by));
  13. driver.findElement(by).click();
  14. }
  15.  
  16. public static void type(By by, String type) {
  17. WebDriverWait wait = new WebDriverWait(driver, defaultWaitPeriod);
  18.  
  19. wait.until(ExpectedConditions.visibilityOfElementLocated(by));
  20. driver.findElement(by).clear();
  21. driver.findElement(by).sendKeys(type);
  22.  
  23. public By login_email=By.xpath("//input[@placeholder='Email ']");
  24. public By login_password=By.xpath("//input[@placeholder='Password ']");
  25. public By login_button=By.xpath("//form[@class='m-t ng-dirty ng-valid-email ng-valid-parse ng-valid ng-valid-required']//button");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement