Advertisement
Guest User

Untitled

a guest
May 1st, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. WebDriver driver = new FirefoxDriver();
  2. String appUrl = "https://accounts.google.com";
  3. driver.get(appUrl);
  4. driver.manage().window().maximize();
  5. String expectedTitle = " Sign in - Google Accounts ";
  6. String actualTitle = driver.getTitle();
  7. if (expectedTitle.equals(actualTitle))
  8. {
  9. System.out.println("Verification Successful - The correct title is displayed on the web page.");
  10. }
  11. else
  12. {
  13. System.out.println("Verification Failed - An incorrect title is displayed on the web page.");
  14. }
  15.  
  16. WebDriverWait wait = new WebDriverWait(driver, 60);// 1 minute
  17. wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("Email")));
  18. driver.findElement(By.id("Email")).sendKeys("TestSelenium");
  19. //WebElement username = driver.findElement(By.id("Email"));
  20. //username.clear();
  21. //username.sendKeys("TestSelenium");
  22.  
  23. WebDriverWait wait1 = new WebDriverWait(driver, 60);// 1 minute
  24. wait1.until(ExpectedConditions.visibilityOfElementLocated(By.id("Passwd")));
  25. driver.findElement(By.id("Passwd")).sendKeys("password123");
  26.  
  27. //WebElement password = driver.findElement(By.id("Passwd"));
  28. //password.clear();
  29. //password.sendKeys("password123");
  30.  
  31. WebElement SignInButton = driver.findElement(By.id("signIn"));
  32. SignInButton.click();
  33. //driver.close();
  34. System.out.println("Test script executed successfully.");
  35. //System.exit(0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement