Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WebDriver driver = new FirefoxDriver();
- String appUrl = "https://accounts.google.com";
- driver.get(appUrl);
- driver.manage().window().maximize();
- String expectedTitle = " Sign in - Google Accounts ";
- String actualTitle = driver.getTitle();
- if (expectedTitle.equals(actualTitle))
- {
- System.out.println("Verification Successful - The correct title is displayed on the web page.");
- }
- else
- {
- System.out.println("Verification Failed - An incorrect title is displayed on the web page.");
- }
- WebDriverWait wait = new WebDriverWait(driver, 60);// 1 minute
- wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("Email")));
- driver.findElement(By.id("Email")).sendKeys("TestSelenium");
- //WebElement username = driver.findElement(By.id("Email"));
- //username.clear();
- //username.sendKeys("TestSelenium");
- WebDriverWait wait1 = new WebDriverWait(driver, 60);// 1 minute
- wait1.until(ExpectedConditions.visibilityOfElementLocated(By.id("Passwd")));
- driver.findElement(By.id("Passwd")).sendKeys("password123");
- //WebElement password = driver.findElement(By.id("Passwd"));
- //password.clear();
- //password.sendKeys("password123");
- WebElement SignInButton = driver.findElement(By.id("signIn"));
- SignInButton.click();
- //driver.close();
- System.out.println("Test script executed successfully.");
- //System.exit(0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement