Using selenium webdriver I am testing login page and some more tabs using eclipse, maven, testng, but in Login page there is OTP verification. So I put OTP manually so. How to continue next proces as a automation?
Asked
Active
Viewed 80 times
1 Answers
2
To continue automation after entering OTP manually using Selenium would be to use the Scanner class as follows:
driver.findElement(By.xpath("xpath_mobile_field")).sendKeys("9818414799");
scanner_user = new Scanner(System.in);
System.out.println("Enter the OTP: ");
String user = scanner_user.nextLine();
driver.findElement(By.xpath("xpath_otp_field")).sendKeys(user);
References
You can find a couple of relevant detailed discussions in:
undetected Selenium
- 151,581
- 34
- 225
- 281