Declined
Last Updated: 02 Jan 2024 11:29 by ADMIN
ADMIN
Faten
Created on: 19 Aug 2014 01:16
Type: Feature Request
3
Update the data source
Hi Team,

I believe that it will be good to have a feature where Test Studio will not pick up the test data or do nothing yet until an event completed its execution. As what the event says 'onbeforetestexecution', so I believe that picking up the data shouldn't happen yet.

My suggestion is to fire the "OnBeforeTestExecution" event prior to reading the data from the bind data source.

Thanks in advance,
Faten
1 comment
Nonito
Posted on: 19 Aug 2014 01:46
I think this will be a good idea. Consider the scenario below:
CSV file is used as data source and bound to your tests. The CSV file contains an indicator to tell a coded script that data needs to be randomized, based on for example, current date+time+ms. You need to do this because your web application accepts unique data only i.e. no duplicate first name, last name and email address.

At the moment, when Test Studio runs your script, it checks if it is data-driven. If it is, it fetches data from your source data and keeps it somewhere. Supposedly, 'onbeforetestexecution' event allows you change the data in your CSV file before test execution starts. This is NOT happening because the data is already fetched and kept somewhere and protected by test studio. To get around this you can follow the two options below:

Option 1: Create a test list where a coded script updates the CSV file before the transactional script is run. 
TestList A:
1. UpdateData (C#)
2. RegisterOnline (non-coded test that uses data from CSV file)

Option 2:  Create a MasterTest that will override the "OnBeforeTestStarted" function and replace the data in the CSV file. Another SubTest that will bind to this datasource.
e.g. MainTest consists of these 2 tests as steps: 
1. MasterTest 
2. SubTest

Both options will fire-off an instance of the browser to update the CSV file. Then, another instance of the browser to run the actual test.

You wouldn't have to go through this work around if Test Studio allows 'onbeforetestexecution' event to change data from a source.