Forum Discussion

_ivanovich_'s avatar
_ivanovich_
Frequent Contributor
10 years ago

How to add assertion in login request in datasource loop

Hi,

i have a very simple login request with a datasource (10 invalid usernames and passwords) and a datasourceloop

so the login request is executed 10 times.

After the execution is finished,  i see all request in green but i used an invalid password, they should be in red

How can i add assertion in each login request

 

Thank you

 

  • You'll want to add an assertion to the step where the login information is validated. Adding a DataSource loop and unchecking the "Abort on Error" selection in the Test Case Options will ensure that your test will run through all iterations of data.

     

    There are many types of assertions available that may suit your needs. For more information on assertions, please see the following doccuments:

     

    Adding Assertions

     

    Introduction to Assertions

     

  • SmartBearAmber's avatar
    SmartBearAmber
    SmartBear Alumni (Retired)

    You'll want to add an assertion to the step where the login information is validated. Adding a DataSource loop and unchecking the "Abort on Error" selection in the Test Case Options will ensure that your test will run through all iterations of data.

     

    There are many types of assertions available that may suit your needs. For more information on assertions, please see the following doccuments:

     

    Adding Assertions

     

    Introduction to Assertions

     

  • nmrao's avatar
    nmrao
    Champion Level 3
    While using the data driven tests, expected result should also be considered as one of the column data. When login failed, you might be getting a soap fault or something. You can add assertion, but the same has to be passed by all the positive and negative tests to as you are going to use one request step for login in the data driven.

    If I were you, i go for script assertion to have better controlled assertion.