I am trying to login to a web application using Selenium and ChromeDriver
. I am able to fill in the email and password fields correctly but every time I click login it requires me to enter a new verification code sent to my email.
If I log in using Chrome normally it will skip this step. Is there a way to open Chrome using Selenium so that it remembers my usernames and passwords?
Here is my code so far:
String baseUrl = "https://www.easports.com/fifa/ultimate-team/web-app/";
driver.get(baseUrl);
driver.manage().window().fullscreen();
Thread.sleep(10000);
WebElement login = driver.findElement(By.xpath("//*[@id='Login']/div/div/div[1]/div/button"));
login.click();
Thread.sleep(2000);
WebElement email = driver.findElement(By.xpath("//*[@id=\'email\']"));
email.sendKeys("******@hotmail.com");
Thread.sleep(1000);
WebElement password = driver.findElement(By.xpath("//*[@id='password']"));
password.sendKeys("*******");
WebElement loginButton = driver.findElement(By.xpath("//*[@id='btnLogin']/span"));
loginButton.click();
Thread.sleep(10000);