How do I test if a user can reset their password (not forgotten) from their profile .

21 views
Skip to first unread message

joka...@gmail.com

unread,
Jan 12, 2017, 10:56:41 PM1/12/17
to Selenium Users
i am testing on a trading platform. one of the tabs is a profile page. on the profile page, there is a link to "change password", and i want to test if that works, using selenium IDE. The problem i am running into is that if the user can change their password, and the test passed, when rerun, i will have have error as the password will already exist. i know i need to use random values using javascirpt but i am not too sure how. any help and demonstration with any website will be very appreciated. I ma very new to selenium. 

Anish Pillai

unread,
Jan 12, 2017, 11:14:44 PM1/12/17
to Selenium Users
Hi,

Try this code -

javascript{Math.floor(Math.random()*100000000)}   This will generate max 8 digit number as the password.

javascript{Math.random().toString(36).substring(2)} 
  This will generate random alphanumeric string


Cheers,
Anish
www.automationtestinghub.com
Reply all
Reply to author
Forward
0 new messages