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

Change bound Data source content in a coded

1 Answer 71 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Iron
Nick asked on 19 Jun 2020, 10:35 PM

Hi, 

Let's consider I have a test named "test_A" (in a list "list_A") bound to data source.

The test contains some coded steps and data source schema is in the attached file.

 

Is it possible using coded step to alter/edit Data source values? For example, let's say I want to set "SkipTest" value for second iteration to "1" in a coded step according to a custom strong verification.

 

I am asking this because I want to have that value present in the result file ".aiiresult" as the corresponding iteration data when executiong "list_A" as it is faked (by me) in Result attached file.

1 Answer, 1 is accepted

Sort by
0
Plamen Mitrev
Telerik team
answered on 23 Jun 2020, 09:16 AM

Hi Nick Cephas,

It is possible to change the Data source values during test execution and it all happens in a coded step. I created a sample test with local data and just one coded step to show you a sample code.

At the start of the code I logged the data source values from the current iteration in the execution log just for reference. Then, I get the current row of data, based on the current iteration index. This allows me to make changes to the values of this iteration during the test execution. As you can see, I changed one value and logged all data source values in the execution log once more. 

After analyzing the execution log, we see that the value was indeed changed and you could use it for something meaningful to your test scenario. That said, the iteration details in the results will remain unchanged, because the data was changed after the iteration started. If you still want to see the updated values, please log them from the coded step as I did in the sample web test.

I hope the above details and sample web test will help you make the necessary data changes and automate the test scenario. Please do not hesitate to contact us again, if you need further assistance. I will appreciate, if you can share more details about your test and the test cases.

Regards,
Plamen Mitrev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
Nick
Top achievements
Rank 1
Iron
Answers by
Plamen Mitrev
Telerik team
Share this question
or