selenium-webdriverui-automationtosca

How to automate tests which requires OKTA OTP verification


How to automate tests which requires OKTA OTP verification?

Use case:

  1. User will enter the internet banking website URL
  2. User will enter valid ID and password
  3. banking website will request an OTP
  4. User receives an OTP on mobile phone
  5. User enters the OTP
  6. Login successful

Is there any plugin / Tool / Utility which will allow me to read the OTP via API's or by any other means?


Solution

  • Though till the time this is still some area which does not have much progress in automation side like Captcha/Barcode/OTP. But you can explore the following options:

    1. OKTA API: Check if OKTA provides an API that allows you to programmatically retrieve the OTP.

    2. Mobile Phone Emulator: Use a mobile phone emulator or simulator, such as Appium, to automate the interaction with the mobile phone. With Appium, you can simulate the receipt of the OTP and extract it programmatically within your automation framework.

    3. Mock OTP Generation: If retrieving the real OTP is not possible or challenging in your testing environment, you can create a mock OTP generation mechanism specifically for automation testing. This could involve generating and storing a unique OTP value within your test environment that can be used during the automation process.

    Regarding the choice of automation frameworks, both TOSCA and Selenium can handle these tasks.