Can we automate OTP in mobile testing without entering the OTP manually?
Is there any dependency to automate OTP?
- Theoretically is possible if the device under test has a mobile number assigned and you receive the OTP code on that device. It should be possible to read the code and then switch back to the app and introduce that code. I don’t believe you need anything else to do it but I expect it to be a pretty involved automation.
- Some devices and apps (see android - How to add auto fill suggestion for otp - Stack Overflow) support automatic filling of the received OTP code, so it might be a solution to just skip a lot of automation.
- If it’s not feasible to have a mobile number on every device under test, then you can use a device just for this: receiving the OTP codes.
If it’s mandatory to provide OTP use database, Once launching the application bot needs to send an email staying Be ready with your mobile you will get OTP in a minute to your mobile so once received you can update that in to database.