Forum Discussion

JenniferC's avatar
JenniferC
New Contributor
11 years ago

Test Login with different values - Any Best Practices?

Hello,

 

My goal is to test using different login values.  I need to change the login name and password value for different test steps. 

 

Is there a best practice on how to do this? 

 

My thoughts

1. Create different Auth defintions  (Not working currently, but seemed like the way to go)

2. Cretae different Enviroment definitions

 

Regards,

Jenn

  • nmrao's avatar
    nmrao
    Icon for Champion Level 2 rankChampion Level 2

    Are you saying you need to execute the same test case with different possible login/passwords? Then you may use Datasource which contains all login/passwords and expected result, then loop thru it, pass the data from current row to test step and verify the result against expected result.

     

    Are you looking for something else? I mean, test against multiple hosts? then envrionments is an option.

    • JenniferC's avatar
      JenniferC
      New Contributor

      Sorry, I have trouble making issue clear.

       

      My test is to verify that non-admin user can not add or delete, but they can view.  Here is my test suite outline.

       

      TEST SUITE

      1. Login as admin user

      2. Verify admin can create object.  (Add Connection web service)

      3. Login as non-admin user

      4. Verify non-admin can view the object created by admin

      5. Verify non-admin can Not add a new object

      6. Verify non-admin can Not delete object creaed by admin

       

      For test steps 1 to 2, require using admin login for the request.

      For test steps 3 to 5, require using non-admin login for the request.

       

       

      • nmrao's avatar
        nmrao
        Icon for Champion Level 2 rankChampion Level 2

        Ok, what did you try and facing any problem as that looks string forward? Have a test case for the steps and use the appropriate credentials for the step as needed.