How to make the webtest use unique values in different runs from data source

Hi,

I have a web test and it pulls data from a table. My requirement is that the web test should use each of the rows in the table only once.

i.e if I execute the webtest once, it pulls the first row. When I execute the web test again, it should use the second rwo but not the first.

Is there any mechanism to achieve this?

[349 byte] By [vasudupe] at [2007-12-24]
# 1

I am not asking about loadtest using unique values.

Multiple runs of same webtest at different times should use different set of data. This is equivalent to deleting the row after using it.

Is this possible?

vasudupe at 2007-8-31 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 2

Please read http://msdn2.microsoft.com/en-us/library/ms182546.aspx, section To Configure data binding in the Web test. It describes how to configure web test to run under setting "One run per dada source row".

Thanks.

YutongMSFT at 2007-8-31 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 3

"One run per data source row"

My understanding is that, if I make the above setting the web test will run 10 times if there are 10 rows in the table. When I run the webtest again for the second time , it will use the same 10 rows and will run 10 times.

My requirement is that,

If a webtest iteration uses a row, that row shouldnot be used for another iteration or another run.

Hope I am clear.

vasudupe at 2007-8-31 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 4

You are right on the "one run per data source row".

Regarding your requirement,

Everytime you run a web test by itself, i.e. either by clicking on Run Test from the Web test editor or running the web test from Test View, the result is saved in a unique-named result file. VSTS does not pass any state information between different web test runs.

Thanks.

YutongMSFT at 2007-8-31 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 5

You are referring to the need for a persistent file cursor between test execution runs. Many of the major competitors have this feature, but I do not think VSTS implements this yet. You will have to come up with your own mechanism to do this. Depending upon the type of data you are avoiding the re-use of, you may want to create your own code via a plugin, extraction rule, etc. to generate this unique data upon each iteration of the Web Test and save it into a Context Parameter.

This is a common automation challenge with applications that require unique values for each instance of a business transaction. For instance, using the example of registering a new account, a new user Id would have to be created every time the Web Test is executed. In these instances it is easier to create code the generates a random/unique user Id, rather than creating a file of user Ids and maintaining it between test execution runs.

MatthewAdcock at 2007-8-31 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 6
Writing your own custom code is probably the best bet. In order for the row to not be used again, you would need to have it removed from the datasource. So if you are querying a database, the next time you query the database, that row should not appear. Also during a run, the data is not re-queried. So if you are removing data from a database during a run, that data will continue to be used for the current run. Check out this blog post for custom data binding: http://blogs.msdn.com/slumley/archive/2006/04/07/570772.aspx
slumleyMSFT at 2007-8-31 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...

Visual Studio Team System

Site Classified