2

How can I automate Confirmation Code using Selenium ?

Update: Our web application ask for mobile number and pin for login and sends confirmation code in sms, which is then entered by user on Confirm Log On. PIN is matched against store value in Database. can be automated. But SMS confirmation code is generated on runtime

3
  • What did you try? What scenario you tried to automate? What exactly is the problem that blocks you moving on?
    – dzieciou
    Commented Feb 17, 2016 at 5:11
  • 1
    Your test needs to click and type some stuff. If you provide more details, we can be more specific.
    – user246
    Commented Feb 17, 2016 at 17:28
  • Scenario is like, our web application ask for mobile number and pin for login and sends confirmation code in sms, which is then entered by user on Confirm Log On.
    – ian
    Commented Feb 18, 2016 at 0:07

1 Answer 1

2

You have to prepare solution on developer's side. Possible solutions are:

  1. All valid codes entered on the testing environment are OK.
  2. The only specific code on the testing environment is OK.
  3. Code simulator/reader is used to deliver the proper code to the testing script. You can then open this reader in another window, read the code, close window and use the code for authentication.

Personally, I like the 2. most. But both solutions 1. and 2. should be removed when an application goes to production. Therefore should be planned as removable, better than configurable. The goal is, that application does not have any possibility to enable it on production.

If you specify closer your problem, technologies, etc... If this is an SMS or RSA token, etc. I can give you further/more specific advice.

Update: for generated confirmation code from SMS all 3 variants can be applied.

  1. (in compliance with 3.) If server side is under your control, you can try to read the SMS text on the server log or on SMS gateway, you can try to switch delivery channel on SMS gateway from SMS to mail etc.
  2. Last, but a bit obscure, could be reading SMS trough testing tools in your physical smartphone. This could be used when you don't have any control of your server side.
1
  • Our web application ask for mobile number and pin for login and sends confirmation code in sms, which is then entered by user on Confirm Log On. PIN is matched against store value in Database. can be automated. But SMS confirmation code is generated on runtime.
    – ian
    Commented Feb 18, 2016 at 0:13

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