Data Created During IExecutionExtension OnInitializeDataSource Not Being Inherited Properly - Issue + Workaround

1 Answer 118 Views
Test Execution Test Results
Billy
Top achievements
Rank 1
Billy asked on 23 Dec 2021, 07:53 PM | edited on 27 Dec 2021, 12:47 PM

First - I read this article.

We have a multi-level-test that is using ExecutionExtensions (another Telerik link).

  1. Test A (Parent) has values that are being set using ExecutionExtensions during the OnInitializeDataSource event.  The data table returns multiple values (columns) across multiple rows.
  2. Test B (Child) has the InheritParentDataSource checkbox checked.

ISSUE: Upon execution, although Test A reports that multiple iterations have been run with correct values in the Test Studio UI, we see the runs are actually re-using the same values from ROW #1 only.

CAUSE: The IsDataDriven property of Test A is FALSE. 

RESOLUTION:
Within the designer/Test Studio UI for Test A, we add a BLANK/EMPTY Local Data Table.  That sets the IsDataDriven property to TRUE.  Then at runtime when the ExecutionExtensions create a new Data Table, the tests properly iterate the rows.

The IsDataDriven property is read-only and it's not clear if/how to set during OnInitializeDataSource.
Feels like a bug, please advise.

 

Elena
Telerik team
commented on 29 Dec 2021, 02:47 PM

Hi Billy, 

Please, take a look at the additional notes on the case in the comment under Plamen's answer.

Thank you in advance for your cooperation.

Regards,
Elena
Progress Telerik

1 Answer, 1 is accepted

Sort by
0
Plamen Mitrev
Telerik team
answered on 27 Dec 2021, 10:42 AM

Hello Billy,

Thank you for your details explanation of your setup and the resolution that you found working. I will share a bit more details from Test Studio's side below.

As you mentioned, the IsDataDriven property of the parent test is set to "false" even though the ExecutionExtension initializes a DataSource for that test. However, the ExecutionExtension does that on runtime and the test's properties are not changed. In addition to that I can say that there is no way to change the test's properties from the ExecutionExtension methods. This results in an issue that we are aware of and the solution is exactly as you explained. You need to add local or external data source to the test to change the IsDataDriven property of the test.

We have discussed this before within the team and other solutions that came to mind would cause braking changes or are complicated to implement. For those reasons, and because the workaround is fairly easy, we have not fixed this behavior. I will raise a discussion again and let you know what is the outcome in the first week of 2022, when everyone is back from the holidays.

I hope the above details help you continue building your automation tests. Please do not hesitate to contact us again, if you have any follow up questions or concerns.

Regards,
Plamen Mitrev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Test Studio course! Check it out at https://learn.telerik.com/.
Elena
Telerik team
commented on 29 Dec 2021, 02:46 PM

Hello Billy, 

Let me also step into this discussion.

Some of the Test Studio tests properties are only meant to be maintained from the project itself. That way we can ensure some expected state for the tests and how these can be used within the project. 

One such property is the one discussed here - the IsDataDriven property. This is supposed to be set only when there is a data source added for this test, otherwise it is set to false. And, as Plamen said, this is by design - one is not supposed to add data in any other way if the test is not enabled for this. 

That said, while preparing the set of nested data driven tests and testing their behavior, you should have added a data source to the parent test. Then, using the Execution Extension you can change this data source in run-time. If you don't want to have any sort of leftover data source, you can add the local built-in data for the test and that way enable the IsDataDriven property.

As a conclusion, it is expected that if the test is not enabled for data binding, it will use only the first row of any data added externally. The IsDataDriven property is read-only by design and can be changed only within the project by adding a data source for the test. 

I hope that this information will be of further help for you to continue setting up your project. Don't hesitate to get back to us in case of any further questions or assistance needed.

Thank you for your understanding and cooperation.

Regards, 
Elena
Progress Telerik

Tags
Test Execution Test Results
Asked by
Billy
Top achievements
Rank 1
Answers by
Plamen Mitrev
Telerik team
Share this question
or