How the web test plugin works  
Author Message
vasudupe





PostPosted: Visual Studio Team System - Testing, How the web test plugin works Top

Hi,

I have two web tests and both of them use the same web test plug in which gets the recordnumbers from local database table. I am using a select statement in the webtest plugin for data binding.

Both the web tests use the same plugin. I get the recordnumbers from the select statement in the plugin.

For example, the select statement returns record numbers A, B, C and D.

So when do loadtest with both the web tests, i think each of the web tests work on A, B, C and D. Is that true If so, how can I make the web tests work on mutually exclusive data. i.e I want webtest1 to work on A and B and webtest 2 to work on C and D. How to achieve this

Are there any resources on how the web test plugin work

Thanks.,



Visual Studio Team System19  
 
 
jakeb16





PostPosted: Visual Studio Team System - Testing, How the web test plugin works Top

Here is some info on web tests

http://msdn2.microsoft.com/en-us/library/ms243191.aspx


 
 
Yutong MSFT





PostPosted: Visual Studio Team System - Testing, How the web test plugin works Top

1) Information on Web test plug-in

Web test plug-ins provide a way for you to isolate some code outside the main declarative statements in your Web test. A customized Web test plug-in allows you to call some code as the Web test is run. The Web test plug-in is run one time for every test iteration. Code in the PreWebTest handler will be called before the Web test starts issuing requests. Code in the PostWebTest handler will be called after the Web test completes. For example, the cleanup code can be inserted here.

Because you have access to the Web test object in the plug-ins, you can manipulate the Web test context, database cursor, or stop a Web test by adding code in different event handlers. For details about how to create a custom Web test plug-in, read How to: Create a Web Test Plug-In.

2) For example, the select statement returns record numbers A, B, C and D.

So when do loadtest with both the web tests, i think each of the web tests work on A, B, C and D. Is that true [Yes]

3) how can I make the web tests work on mutually exclusive data. i.e I want webtest1 to work on A and B and webtest 2 to work on C and D. How to achieve this

Read Sean's post on custom data binding. http://blogs.msdn.com/slumley/archive/2006/04/07/570772.aspx.

In the CustomDS class, there is a function called GetNextRow. I think you can modify the class and insert your logic into GetNextRow.

Thanks!



 
 
Yutong MSFT





PostPosted: Visual Studio Team System - Testing, How the web test plugin works Top

Another helpful post http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=148959&SiteID=1.

 
 
vasudupe





PostPosted: Visual Studio Team System - Testing, How the web test plugin works Top

>> So I when do a loadtest with both the web tests, i think each of the web tests work on A, B, C and D. Is that true [Yes]

Are you sure, becuase I see it working other way round. I am using the code provided in http://blogs.msdn.com/slumley/archive/2006/04/07/570772.aspx.


 
 
vasudupe





PostPosted: Visual Studio Team System - Testing, How the web test plugin works Top

I used a constant load of 2 users with two webtests in the load test. And then I verified in the SQL profiler with what data the requests were made.

The requests from webtest1 were using different data from the webtest2 requests. My select statement is "select top 20000 * from Records"


 
 
Yutong MSFT





PostPosted: Visual Studio Team System - Testing, How the web test plugin works Top

If you are using Sean's code, the results you got in your testing are as expected. Sorry, I did not get this information when I sent out the first reply.

Thanks for the feedback.



 
 
vasudupe





PostPosted: Visual Studio Team System - Testing, How the web test plugin works Top

Thanks. You are very helpful.
 
 
Awais786





PostPosted: Visual Studio Team System - Testing, How the web test plugin works Top

i just implemented this code from Sean Lumley's Blog .

but the problem is my table has 3 records but it runs only once for first row.i dont know why can some one tell me how it will run for all rows existing in table.

i m using code as it is.do i need to call Getnextrow in post web section.although i tried that 2 but no result.



 
 
Yutong MSFT





PostPosted: Visual Studio Team System - Testing, How the web test plugin works Top

Please start a new thread and post your question. Thanks!