1

I have a scenario where I need to perform a login, but the problem is its based on OPT (I mean once I enter a phone number to that number I receive an OTP That OTP is the password)

asked Nov 14, 2018 at 6:39
1
  • Generally the problem is knowing what the OTP is. Which means from a testing standpoint you have to be able to fetch the password prior to use. Commented Nov 21, 2018 at 16:11

1 Answer 1

0

In software testing companies generally we are automating it by storing OTP in Database and then it is easy to automate by us while devops testing. You can use sql connection and get the 'OTP' code.

Please find below code snippet in support of above suggestion. I hope this approach will work well for you.

import pyodbc 
cnxn = pyodbc.connect("Driver={SQL Server Native Client 11.0};"
 "Server=server_name;"
 "Database=db_name;"
 "Trusted_Connection=yes;")
cursor = cnxn.cursor()
cursor.execute('SELECT otp FROM Table')
for row in cursor:
 print('row = %r' % (row,)) 

Thanks.

answered Nov 14, 2018 at 7:01

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.