I have an app that would ask me to enter a verification code from a received SMS. How do we get around that or if there is any mechanism to enter the code at all?

This is an automated UI test using Appium and C# as my language. I test it using a real mobile device. I don't care about verifying the 2FA, as long as I get to the home screen of my app is what I care about testing.

  • Why not provide your phone number, receive SMS and Type the code you got in the SMS?
    – dzieciou
    Sep 20, 2019 at 13:17
  • would that mean, in my script, I had to switch over to the sms just to get the code?
    – Marj
    Sep 20, 2019 at 13:19
  • 1
    You have not explained this is an automated test. Can you please add some more details about the test? How do you run the test? Can you control the app aka ask devs to disable 2FA? Do you care about verifying 2FA or this just a prerequisite for further tests?
    – dzieciou
    Sep 20, 2019 at 13:32
  • 2
    Any particular reason to not create an endpoint protected by feature flags where you can fetch tokens directly? Sep 20, 2019 at 13:32
  • @JoãoFarias I have not thought about this. I am creating a proof of concept to our team and the app is installed and sent to us by our vendor.. creating an endpoint for this isn't a part of the budget :D
    – Marj
    Sep 20, 2019 at 15:17

1 Answer 1


Use a service like https://www.twilio.com/ to recieve the SMS by your code. They provide phonenumbers, API's, etc...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.