One lesser hectic method to retrieve the OTP from SMS.
There is an android app/website:
mysms.com, it gives us free SMS push service, where you can get your text messages directly on a website.
Prerequisites to use this method:
- You should have an android phone
- Phone should be connected to Internet when script is running
- Phone should have an app “MySMS” installed
- User should have an account on mysms.com with that phone number
How does it work?
Whenever any message comes in your inbox, it will push it to your web account in a fraction of seconds and then use your automation scripts you can retrieve the message info from the webpage (which will have your OTP).
Setup one time, and use it for many times.
Advantages of using this method:
- The physical presence of your phone is not needed.
- You don’t need any extra appium script to automate your phone messaging app.
- You will get your OTP by hitting a simple Web URL.
- It will be easy to implement and fast for sure.
Limitations of this method:
- It depends on the Mobile network, if there is no cellular network, you won’t get any OTP.
- You need to have a dedicated android device /phone number in order to use it (this app is not free for iPhone devices).
I have tested this feature on my android phone and its working fine. There are other apps available in the market which provide you some kind of SMS push services, you can pick any app.
Also, for those who want to automate the OTP for any mobile number outside India, they can use this website – http://www.receive-sms-online.info/
Looking forward to getting some more efficient methods to resolve this problem. Please reply if anyone has any.