I want to login by Selenium
. It is divided the process into 2 pages.
- password
Now I can input the key in first page .Then I should go next page (input password and click submit key).
However , If I just add 4 keys codes in one class ,it cannot complete the second page key input (password and submit )
I guess some code is missing between first page key input and second page key input.
public class Selenium {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
WebDriver driver;
System.setProperty("webdriver.gecko.driver", "C:\\Users\\Downloads\\geckodriver-v0.10.0-win64\\wires.exe");
driver =new FirefoxDriver();
driver.get("https://mail.google.com");
driver.findElement(By.id("Email")).sendKeys("yourEmailId");//first page
driver.findElement(By.id("next")).click();//first page
driver.findElement(By.id("Passwd")).sendKeys("yourPassword");//next page
driver.findElement(By.id("signIn")).click();//next page
}
driver.get("https://mail.google.com");
driver.findElement(By.id("Email")).sendKeys("yourEmailId");//first page
driver.findElement(By.id("next")).click();//first page
/* What code should I add here? */
driver.findElement(By.id("Passwd")).sendKeys("yourPassword");//next page
driver.findElement(By.id("signIn")).click();//next page
}