This is a migrated thread and some comments may be shown as answers.

testing different level users

3 Answers 88 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 23 Aug 2016, 05:01 PM

What is the "ideal" and most efficient way to test this simple test scenario:

I have 2 types of users - Field and Admin. I need to log in as a Field user and verify some text on the logged in page. After that, I need to log in as an Admin and do the same (verify some text on the logged in page). 

In my test project I imagined something like this:

1. create "Login" test

   - databind / set test custom property / set 2 global variables in script of the username and password in test properties 

2. create "Login Field test"

  - add Test as Step (Login) and set guest's username and password wherever we stored credentials

  - add verify step to check for text

3. create "Login Admin test"

  - do the same as above steps

To organize everything, I would put the Login test step under the project (since it will be used for other tests in the project) but I would create a sub-folder and group the 2 tests inside since they both are related. I would then go the Test Lists and configure a new list with the 2 tests to finalize everything. 

 

Few questions that came up:

- Where can I get more information on the Custom Properties that the Test Details offer? Is this applicable to store the username and password here to databind as in my Login test step example? How would we access these values in the Standalone (like a $(variable) and in the code behind, if it's even possible?

- Do we have any videos/links that are similar to this scenario to check out? I've seen a few but just wanted to get advice from the experts :)

 

Any feedback, ideas, advice, common pitfalls doing it this way, etc is greatly appreciated!

- Chris

 

 

3 Answers, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 26 Aug 2016, 01:39 PM
Hi Chris,

Your scenario is quite common and not difficult to maintain. In general your approach is correct and only few things could be added to improve it. First of all I will clarify the purpose of the custom test properties - they are for your ease if there are comments you would like to share for other coworkers using the same project, or some specifics for the test, or use them to add test to a dynamic test list, etc. So you could store username and password into these but only for your reference and not use them in the test itself. 

Global variables could be set into a standalone code file that will be accessible within the whole project. In your scenario I assume data driven testing would suit better. The idea of the data driven testing is to use a single data source and execute the same test multiple times. Since both tests have exactly the same steps against the same elements and only the values are expected to differ you could combine them in a single test and only prepare a proper data source. If you choose this option you would need to add the login steps directly to ensure the correct data will be passed to the fields. Here is an article for the multi level data bound tests and how they work. Columns from the data could be also bound within code

There is no video available but I will share a general article how to best configure your project using all of the advantages Test Studio offers.

Please let me know if you would need any further advice - I will be glad to assist you! Thanks! 

Regards,
Elena Tsvetkova
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Chris
Top achievements
Rank 1
answered on 06 Sep 2016, 03:35 PM
Thanks for your feedback Elena
0
Elena
Telerik team
answered on 08 Sep 2016, 02:35 PM
Hi Chris,

I am glad I was able to provide you useful information! 

Regards,
Elena Tsvetkova
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Chris
Top achievements
Rank 1
Answers by
Elena
Telerik team
Chris
Top achievements
Rank 1
Share this question
or