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

Inserting data driven tests inside other driven tests

3 Answers 11 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jan
Top achievements
Rank 1
Jan asked on 25 May 2016, 08:45 PM

Hello! Quick question regarding how data driven test structure works.

Let's pretend I have test A which logs into a website. Test B will now now use test A using 'test as a step' to get to the webpage and do additional things on the page.

Now let's say I want to want to use different accounts for test A to log into the website so test A is now data driven. However, the content on the website changes for each different account so if I turn test B data driven as well, I need to verify certain elements that correspond to the account that was used to log in.

If I follow this workflow however, and use data driven test A as a 'test step' inside test B, test A will run through all of it's data driven iterations before running anything in test B.

I want each the data for test A and B to be executed in tandem so the flow becomes:
log into account 1, verify on the website data belonging to account 1
log into account 2, verify on the website data belonging to account 1

How it currently works however, given my test flow, is:
log into account 1
log into account 2

verify on the website data belonging to account 1,

verify on the website data belonging to account 1

..which is not what I want. The only alternative I can think of is not using 'test as a step' to bypass the way the data driven logic is currently behaving. If there is any other way to switch up the order of how data driven tests work, please let me know, thanks!

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Boyan Boev
Telerik team
answered on 30 May 2016, 01:29 PM
Hello Jan,

Thank you for contacting us.

This can be achieved as follows:

1. Create one parent test which will have two test as steps (Test A and Test B).

2. Create one data source with different columns for Test A and B.

3. Bind the parent test to that data source.

4. In the properties of Test A and B check InherintParentDataSource and DataEnabled.

5. Bind the steps you want in the both tests to the column you want. Note that you should type the column names manually in the step properties (bindings) click the brackets and then the Set button.

Find attached a demo project.

Let me know if that helps.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Jan
Top achievements
Rank 1
answered on 07 Jun 2016, 07:17 PM
Thanks Boyan, that was a great help!
0
Accepted
Boyan Boev
Telerik team
answered on 09 Jun 2016, 07:52 AM
Hello Jan,

You are very welcome.

If you need further assistance please let us know.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Jan
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Jan
Top achievements
Rank 1
Share this question
or