need help with looping in a coded web test

Feb 18, 2010 at 5:35 PM

Hi All,

I am trying to loop through a web request a fixed number of times, but because my web test is data bound , all the requests are run the number of times as there are records in a database.

My scenario is as follows:

I have to validate web request 1 for the first 10 records in the database and web request 2 for the next 10 and so on. But presently, due to data binding all the requests are run for all the records in the database. can I do something like this? if yes, please hint on how I can do it!!

Dint know any other place where I could post did it here(Also let me know if I can ask such questions elsewhere!!!)


Mar 9, 2010 at 1:22 AM

As discussed over email, WebTest doesn’t allow partially selecting rows/records in a table for a given web request. In your case, you'll have to write customized code in C# and ADO.NET to partially select the first 10 records for web request 1, second 10 records for web request 2, etc. Please make sure that you have the option 'One run per data source row' deselected. See here for more details.

If that doesn’t help, you can try searching this forum for a similar problem posted by someone else, otherwise you could pose your question there by selecting the ‘Ask a question’ link on the page. That way, you can get help from the folks who actually developed WebTest in Visual Studio. 

Hope this helps.