TestProject Forum

Help me for the setting

sorry, if in the csv I insert password and user as in the example documents, and I insert password, user_name, 12345, carl “that would be the correct ones”, and then I insert the wrong passwords and users, because when I test him gives me 100% success? while I expect it to give me success only for the first exact line … what am I wrong with the settings?

Hi @vale.

Can you please elaborate on the scenario?
When should the test fail?

I’d be happy to assist!

Regards,
Ricardo.

hi, when I download the csv parameter, I set the various values ​​in the columns, exact values ​​and incorrect values, and then I reload the csv on the datatasource, and I start it at the end of the test, it gives me the 100% success message, while I expect that in the values ​​where I set the wrong value give me error.

I expect you to pass only the first test
?
help me pls
am I wrong in setting something? because I enter 3 passwords 1 right and two wrong, I expect the first to give me “OK”, while the other two give me “KO”

Hi Val,

Please check if you are selecting run type as Use DataSource when executing the script. If you are not selecting the data source option then it might be taking the default data from the parameters

If this is not the case then please add more information on how are you using and running the scripts.

Thanks,
PS

yes that step I do only that in the execution, he gives me success even if he reads the wrong password

Hi @vale .

It seems like you have no assertions steps, meaning in no point you are validating the success of the login flow. Therefor the test will always pass.

If you want to get a failed test when giving the wrong password, you have to define in your test what means “fail” for you. The machine doesn’t know that “12345” is the correct password but “33334” is not.

There are many ways to achieve that, for example:

  • check if you succeeded to login by checking if an element exists (one that only exists when you are already logged in). If the step fails (because the element is not found) it means we gave the wrong password.

  • Checking if got the error message “Password is invalid” :

Please try adding one of these validations to your test and it should give you “fail” when typing the wrong password.

Kind regards,
Ricardo.




“check if you succeeded to login by checking if an element exists (one that only exists when you are already logged in). If the step fails (because the element is not found) it means we gave the wrong password.”

how do you do this?
I’m stuck, I don’t know what to do, it’s the first time I look into this app, could you tell me step by step what I should click, where and what to put … please

Hi Vale,

What is the if condition you are providing in the step?

Thanks,
PS

the if condition is if password is equal to 12345, and in fact if I put this condition, it does not give me success, it gives me skipped, and opening the passwordo field on the condition if it gives me KO … but in the final report it gives me success

Hi @vale .

There are many ways to validate a password.

  • If there is only a single correct password(like in your case it has to be always “12345”), you can simply add a step(after the one that types the password) that gets the typed password, store it into a parameter, and add a validation. Like this:

  • In other cases, when there are many different passwords(like any application that has a login with a different password to each user), you can check if you succeeded to login by checking if an element exists (one that only exists when you are already logged in). If the step fails (because the element is not found) it means we gave the wrong password. Like this:
  1. Click on the “Login” button:

  2. Select an element from the next page and add a validation to check if it is clickable. Like this:

So, if the element is not found, it means we gave the wrong password.

Let me know if it was helpful :slight_smile:

Also, I highly recommend joining our live demo!
It’s a 1-hour training.
This is the direct link to the Live Events Schedule:

Save your seat :slight_smile:

Kind regards,
Ricardo.

thank you very much for helping

@vale Always welcome!

Let us know if there is anything else we can help you with!