Data driven - Test as Step

10 posts, 0 answers
  1. Rupesh
    Rupesh avatar
    2 posts
    Member since:
    Jun 2012

    Posted 22 Mar 2012 Link to this post

    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
  2. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 22 Mar 2012 Link to this post

    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
  3. Ninja
    Ninja avatar
    10 posts
    Member since:
    Aug 2011

    Posted 23 Mar 2012 Link to this post

    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
  4. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 26 Mar 2012 Link to this post

    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
  5. Ninja
    Ninja avatar
    10 posts
    Member since:
    Aug 2011

    Posted 28 Mar 2012 Link to this post

    Ivaylo,

    Can 2 tests share a single excel sheet with multiple sheets in it for data driven testing? If yes how.
  6. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 28 Mar 2012 Link to this post

    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
  7. Ninja
    Ninja avatar
    10 posts
    Member since:
    Aug 2011

    Posted 29 Mar 2012 Link to this post

    Ivaylo,

    I forgot to mention that I am using VS 2010 for development.
  8. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 29 Mar 2012 Link to this post

    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
  9. Ninja
    Ninja avatar
    10 posts
    Member since:
    Aug 2011

    Posted 02 Apr 2012 Link to this post

    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?
  10. Ivaylo
    Admin
    Ivaylo avatar
    750 posts

    Posted 04 Apr 2012 Link to this post

    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
Back to Top
  Cast Your Vote at DevPro Connections! Cast Your Vote at  Win IT Pro Connections!