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

Using Same Test (Test as Step) with different Data Set on multiple tests

7 Answers 203 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Venkat
Top achievements
Rank 1
Venkat asked on 22 Aug 2016, 03:50 PM

Hi,

 I'm stuck with this and hope someone can guide me in the right direction. Most of the data driven tests works as expected but we have some scenarios which need to run the test as step in multiple tests with different data set. ill run through the scenario here 

Scenario - 1:

Test A - Login - Data driven
Test B - Create some prescriptions - Data driven - (Runs 4 times with given data to create prescriptions)
Test C - Verifies the above prescriptions and does something else (Data driven)
Test D - Executes Tests A, B, C

 Scenario - 2:

Test A - Login - Data driven
Test B - Create some prescriptions - Data driven - This now only need to run 2 times with different data
Test C - Verifies the above prescriptions and does something else (Data driven)
Test E - Executes Tests A, B, C

Thanks

7 Answers, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 25 Aug 2016, 01:19 PM
Hello Venkat,

Thank you for choosing Telerik Test Studio and contacting us. 

As far as I understand your scenario you need to bound different data to Test D and Test E. I think you would find interesting that Test Studio could execute multi level data bound tests. Please review the covered scenarios in this article and let me know if that would suit your query. In case of any further questions do not hesitate to continue this communication. 

Regards,
Elena Tsvetkova
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Venkat
Top achievements
Rank 1
answered on 26 Aug 2016, 08:56 AM

Hi Elena,

Thanks for the reply.

I have looked at the multi level tests but doesn't give me a solution to my issue.

In my scenarios, all the test as steps have different data sets bound to them and also I will have test as step within same scenario run with different data set. Can you run me through if you can achieve this with multi level tests.

Let me give me more explanation here:

Scenario :
Test A - Login - Data driven - only need to run once
Test B - Create some prescriptions - Data driven - (Runs 4 times with given data to create prescriptions)
Test C - Verifies the above prescriptions and does something else (Data driven)
Test D - Executes Tests A, B, C and B again with different data set(Runs 2 or 3 times)

Thanks

 

 

 

 

0
Daniel Djambov
Telerik team
answered on 31 Aug 2016, 04:51 AM
Hello Venkat,

Yes you can achieve what you want with multi-level tests using different data. You have to use a Test Property called InheritParentData (see attachment). To access test properties from Project Explorer right click on the test and select Properties option from context menu.

What you only need is the Column names of the Parent and Child tests you want to change data to be with the same names.

Once this property is checked test will work like this - if you run the Child test by its own it will run data iterations with its own data, but if you run it as test as step from another test it will use the data of the parent test instead. I think this is what you wanted.

Best Regards,
Daniel Djambov
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Venkat
Top achievements
Rank 1
answered on 05 Sep 2016, 09:23 AM

Hi Daniel,

I have used that inheritparentdata property but not sure its the best option for me.

What I have to currently do is this.

Test A - Child Test  (Data driven - only 1 row of data)

Test B - another Child Test (Data driven - multiple rows of data)

Test C - Parent Test - Includes Test as Steps Test A and Test B

here i cant databind Test C, as there are multiple rows in my 2 embedded tests. and also Test C uses Test A multiple times with different data set. 

so what im doing is creating

Test D - Just got 1 step, Test A - databind to data1

Test E - Just got 1 step, Test A - databind to data2

and now Test C calls Test D, Test B then Test E, is this the only work around or is there a better way to recreate this scenario for example using loops?

Thanks,
Venkat

0
Elena
Telerik team
answered on 08 Sep 2016, 08:18 AM
Hello Venkat,

Your scenario is quite specific and because of the different data sets you need to use there is no straight forward approach you could apply. Honestly I get lost while trying to recreate your scenario without exact data behind. However I think you could give a try to the loops - what is here important to note is that when the test enters into the loop all steps within will be executed and in case there is a data bound step all its iterations will be executed. If you use the while loop you could data bind the verification used within the while. 

Please give a try to these if you find it applicable and useful and let me know if I could assist you further. Thank you in advance for the cooperation! 

Regards,
Elena Tsvetkova
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Venkat
Top achievements
Rank 1
answered on 08 Sep 2016, 08:37 AM

Hi Elena,

Thanks for the reply. I tried using conditions and there isn't any real help with them in my scenario tests.

Is there a way we can databind the test as steps? that will solve lot of my issues. Mainly i don't have to duplicate my tests in project. I'm sure many with agree with this. 

Thanks,

Venkat

 

 

0
Elena
Telerik team
answered on 12 Sep 2016, 08:10 AM
Hi Venkat,

I hoped conditions might help you and am sorry to hear it didn't bring improvement for your setup. Please be informed that test as step could not be data bound. Each test could be data driven and bound to a source and used as a test as step. Depending on the required scenario the best approach for you might be to duplicate the tests in your project because of the different data sets you need. You might try to change the data source in a way that could handle the available features in Test Studio. 

There is an approach to data drive a test non iterative - this might be of interest for you and could lead you to an idea. 

Thank you for your understanding! 

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
Venkat
Top achievements
Rank 1
Answers by
Elena
Telerik team
Venkat
Top achievements
Rank 1
Daniel Djambov
Telerik team
Share this question
or