Data-Driven testing not working properly in sub test

3 posts, 0 answers
  1. Teng Geok
    Teng Geok avatar
    2 posts
    Member since:
    Apr 2012

    Posted 10 Apr 2012 Link to this post

    Hi,

    My situation:
    1. I created a data driven test case and test it independently, as a main test, bound to an Excel data source.
    2. In this test, the data is bound to some list box selection.
    3. Works perfectly and the list boxes are selected according to the data set.
    4. I converted this test case into a sub test to increase usability and maintainability of the test cases
    5. I have enabled the "InheritParentDataSource" check for the test.
    6. I have removed the data binding for the test.
    7. I have created a main test case and bound it to the same set of Excel dataset
    8. I execute the sub test as a test step in the main test.
    9. Now, the list box selected does not follow the dataset anymore.
    10. I checked the sub test again and couldnt see any differences.
    11. I "Customize Test In Code" those listbox selection steps and realize something interesting.

    If the sub test is bound to the data set, when i customize the step in code, I see:

    Pages.MyPage.MyFrame.MyListBox.SelectByText(CType(System.Convert.ChangeType(Data("MyField"), GetType(String)),String), true)

    If the sub test is not bound to the data set, when i customize the step in code, I see:

    Pages.MyPage.MyFrame.MyListBox.SelectByText("XXXXX", true)

    Is there some other settings I need to set for the sub test to get the result I want? Or is still going to be a future enhancement? If so, what is the temporary workaround you can advice?

    Thanks

  2. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 11 Apr 2012 Link to this post

    Hi Teng Geok,

    When you remove the Data Binding, Test Studio automatically disables the DataEnabled property on the sub-test(see screenshot). Even though InheritParentDataSource is checked, you still need to check DataEnabled so Test Studio correctly enables data binding for the sub-test.

    Regards,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Teng Geok
    Teng Geok avatar
    2 posts
    Member since:
    Apr 2012

    Posted 11 Apr 2012 Link to this post

    Hi Plamen,

    Thank you so much. It works!

    Keh
Back to Top