How the web test plugin works
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.,
[768 byte] By [
vasudupe] at [2007-12-24]
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!
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"
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.