TestProject Forum

If-Else logic for incorrect password

Hello everyone!

I have a form where I have to fill in my e-mail address and password and then click on the Login button. The text “Incorrect password” is displayed. How can I create a step where this use case is taken into account and fill in the correct password if the validation text is displayed? I am interested in this in terms of a data driven test where several email addresses and passwords are filled in (if- return - else).

Thank you in advance for the answer!

Hello,
you want something like a loop step ( search around, there’s examples ) with these input parameters: iterator, arrayOfUserAndPasswords, badPassword ( false at start ) and output iterator+1, badPassword
[
extract from arrayOfUser… all params you need below
fill username
fill password
press submit
check validation and adjust accordingly in variable badPassword
fill GoodPassword ( if badPassword )
press submit ( if badPassword )
]
continue … with validation of being logged in.

Long story short: You need to iterate over a data set ( I suggest using json objects and cuv read) and process them in a loop. Testproject allows you to do 99 loop for a test entry. That is the limit.
If you need more loops, need to do some engineering or use another tool, like load testing ones.