2

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?

undetected Selenium
  • 151,581
  • 34
  • 225
  • 281
upen kale
  • 21
  • 1

1 Answers1

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