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)

  • 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. – Marcel Wilson Nov 21 '18 at 16:11
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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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