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

Data-Driven testing not working properly in sub test

2 Answers 47 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Teng Geok
Top achievements
Rank 1
Teng Geok asked on 11 Apr 2012, 03:57 AM
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 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 11 Apr 2012, 06:23 PM
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
0
Teng Geok
Top achievements
Rank 1
answered on 12 Apr 2012, 02:31 AM
Hi Plamen,

Thank you so much. It works!

Keh
Tags
General Discussions
Asked by
Teng Geok
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Teng Geok
Top achievements
Rank 1
Share this question
or