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
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.
Ivaylo
the Telerik team
Test Studio Trainings
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
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.
Ivaylo
the Telerik team
Test Studio Trainings
Can 2 tests share a single excel sheet with multiple sheets in it for data driven testing? If yes how.
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.
Ivaylo
the Telerik team
Test Studio Trainings
I forgot to mention that I am using VS 2010 for development.
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
Test Studio Trainings
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?
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.
Ivaylo
the Telerik team
Test Studio Trainings