VS 2010 Network Test - a unique value for every virtual user from CSV

I have 50 usernames and password in CSV. I want to run a web load test, where each virtual user is assigned one unique value for the duration (1 hour) of the load test for several iterations. How this is done in the version of VS 2010 Ultimate.

thanks

+4
source share
3 answers

Create and add a new WebTestPlugin in whose PreWebTest event you call the MoveDataTableCursor () method of the WebTest object, giving it the value of the context parameter $ WebTestUserId (e.WebTest.Context.WebTestUserId). Also make sure that the data source is set to Do not move the cursor automatically. This blocks the virtual user in a row in your data table.

CAVEAT: this will only work if you work locally or with ONE agent and with only one script in LoadTest, because WebTestUserId is NOT unique to agents or scripts (unlike documentation). If you have configured multiple agents, your plugin will need to know how to split data rows between agents. There is no way to work with it in several scenarios - for this you will need a smarter solution.

Also note that WebTestUserId starts at 0 in LoadTest, but starts at 1 in standalone WebTest (who knows why?).

+6
source

The caution mentioned in @agentnega kinda made me think, so I found this

single machine tests

  • Serial is the default and tells the web test to start with the first row, then retrieves the rows in order from the data source. When it reaches the end of the data source, it goes back to the beginning and start again. Continue until the load test is complete. In a load test, the current row is stored for each data source in each web test, and not for each user. When any user starts an iteration with a given Web test, they are assigned the next row of data, and then the cursor is advanced.

  • Random - this indicates a random selection of lines. Continue until the load test is completed.

  • Unique - this means that starting from the first row and selecting rows in order. As soon as each line is used, stop the network test operation. If this is the only web test in the load test, then the download test will stop.

Several machines working as installation

  • Serial - this works just as if you were on the same machine. Each agent receives a complete copy of the data, and each starts at line 1 in the data source. Then each agent will go through each row in the data source and continue the cycle until the load test is completed.

  • Random - it also works the same as if you ran the test on the same machine. Each agent will receive a full copy of the data source and randomly select rows.

  • Unique - this one works a little differently. Each row in the data source will be used once. Therefore, if you have 3 agents, the data will be distributed among 3 agents, and not a single row will be used more than once. As with one machine, as soon as each line is used, the web test will stop executing.

Source http://vsptqrg.codeplex.com/

+6
source

Sean Lumley published a web testing plugin in 2008 that distributes data between agents to send unique values ​​even when using multiple agents ( link here ):

<pending code sample. Hold on. >

-1
source

All Articles