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

Data driven - Test as Step

9 Answers 145 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rupesh
Top achievements
Rank 1
Rupesh asked on 22 Mar 2012, 06:48 AM
Hi All,

Suppose I have a Test case to login to Gmail account (say Test Case A) which is data driven from xls sheet.And I have used this test case as a Step in test Case B.
Now my question is I want to execute a step (which is Test Case A) from Test Case B with a different xls sheet for data, I dont want to use the same xls sheet which was binded to Test Case A to run Test Case B,is this possible and how?

Thanx in advance

9 Answers, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 22 Mar 2012, 04:21 PM
Hello Ankit,

Yes you can do that and it is quite easy. Just set the InheritParentData property on Test Case A, so when executed as a test step in Test Case B it will inherit it's data. I've managed to record a short video for you showing how to accomplish this, I used local data, but it works the same as using a data from an external data source. 

Hope this will help you out.

Kind regards,
Ivaylo
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Ninja
Top achievements
Rank 1
answered on 23 Mar 2012, 03:31 PM
Hi Ivaylo,

I have 2 questions,
1. I didn't understand the meaning of InheritParentDataSource property - if this property is set to True for Test Case A then by the name of the property Test Case B(in which Test Case A is a step) should be able to use DataSource of Test Case A, this is what I am understanding by the name of the property.

2. VS 2010 plug-in : Suppose there are 3 test cases which are data driven viz Test Case A(uses A.xlsx),Test Case B(uses B.xlsx) & Test Case C(uses C.xlsx).After all this I have to use Test Case A & B as steps in Test Case C with AC.xlsx(for Test Case A in Test Case C) & BC.xlsx(for Test Case B in Test Case C) as data.Will you please explain me how to do this?


Ninja
0
Ivaylo
Telerik team
answered on 26 Mar 2012, 05:13 PM
Hello Ankit,

On your first question if you set the option InheritParentDataSource to test A, and include it into a test B as Test as a Step, the test A will execute with the data binding entered for test B. IF you refer to the video I made for you and posted in my previous reply you'll see that test A executes with the data binding for test B.

On your second question, unfortunately dynamically binding data is not currently a built-in feature in Test Studio but you can review this article providing you solutions on how you can proceed. 

All the best,
Ivaylo
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Ninja
Top achievements
Rank 1
answered on 28 Mar 2012, 07:56 AM
Ivaylo,

Can 2 tests share a single excel sheet with multiple sheets in it for data driven testing? If yes how.
0
Ivaylo
Telerik team
answered on 28 Mar 2012, 03:18 PM
Hello Ankit,

Yes, 2 tests can use a single excel sheet with multiple sheets for data driven testing. Please check this video I have made for you showing you the steps. I have created an excel file with 2 sheets and added it as a data source prior to recording the video.

Hope this will help you out.

Kind regards,
Ivaylo
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Ninja
Top achievements
Rank 1
answered on 29 Mar 2012, 07:32 AM
Ivaylo,

I forgot to mention that I am using VS 2010 for development.
0
Ivaylo
Telerik team
answered on 29 Mar 2012, 04:55 PM
Hello Ankit,

Yes you can use single excel file with multiple sheets with Visual Studio as well. Please check this article to check how to bind a test to an external data source.

All the best,
Ivaylo
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Ninja
Top achievements
Rank 1
answered on 02 Apr 2012, 12:20 PM
Thanx Ivaylo,that article helped me a lot.

One more question I have is,suppose I have a test list which contains 2 tests which are data driven and which uses 2 different spreadsheets.Now what I want to achieve is when I execute this test list it should run with earlier 2 spreadsheets and 2 new spreadsheet(new data) as well.How is this possible?
0
Ivaylo
Telerik team
answered on 04 Apr 2012, 03:59 PM
Hello Ankit,

Unfortunately this cannot be done in the exact way you would like since you cannot bind more than one sheet to a single test. However there is quite easy to accomplish workaround on your question. Having the initial 2 tests in a list which are using 2 different spreadsheets you can simply duplicate them and bind the new couple of test with the new spreadsheets. This way you'll have 4 tests in your test list, first two will be using old data and the next two will be using the new data.

Hope this helps.

Greetings,
Ivaylo
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Rupesh
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Ninja
Top achievements
Rank 1
Share this question
or