Load Test and Unique Data biding
Hi
iM gonna explain what i want to do and how My application works...
I have an account search page,there i enter My account, password and report date, after this the systeM creates a PDF file like this AccountNumber.PDF and responses me with that file (this file contents all the site activities done at the date range).
Now...
I recorded and edidted a web test, so it generates a PDF for each row of my data source, using extration rules i can validate if it is giving me the right file. Now its time for Load testing.
I tried with 10 concurrent users for 2 minutes, just to check the load tests, and on the test summary report i got a total tests of 87 but 74 of them where Failed Test cases. So i started researching why was that, and i found out that if i request the file generation with the same user the first request will be successful, but the other requests using that account number will fail, giving me a 403 or 500 server error. This gave sense to the 87/74 situation, because my database had only one register.
So i tried having more accounts, and as i thought the errors became like 3 o 4, now, after all this long explanation comes my questions:
1-. Is there a way to use random data for the web test?, i want to do something like this: i have my webtest and 20000 accounts numbers, at the load test i want to test it for tne minutes, and i want to try with random account numbers, is it possible?
2.- Can i validate somehow if the account number is already on a live request to skip it and try the next account number until it finds one not being used by a test?, i can "re-use" the numbers just dont wanna use them if they are already "on use", if i can do this then all the errors caused by duplicate account numbers used will be eliminated giving me a real status on the errors
I hope you can help me to get some ideas and thank you for reading all this
[1975 byte] By [
VladOxa] at [2007-12-31]
I think you have at least 2 options here, potentially the easiest of which would be to generate a data source with your 20000 account numbers and set the Access Method on your data source to "Unique", this way you're guaranteed no two tests will be using the same account number. I know you're goal is to just not have them use the same account number at the same time but unless you're also specifically wanting to reuse account numbers this is probably easiest. There is an option for randomly selecting from the data source, and this will choose the rows more than once if the loadtest runs long enough but I don't think you necessarily have any guarantee that two tests won't try to use the same number at the same time (although it seems somewhat unlikely if you have a large number of rows to choose from and a relatively small number of users).
Another option is to write a LoadTest plugin. In the LoadTestStarting event handler you could do something like create an object of type Random and put it in the loadtest context, then in the TestStarting event you could pull the next random number and add it to the individual tests context. In the webtests you would then bind your querystring or form parameter for account number to this context parameter.
Let me know if neither of those is what you're looking for, maybe we can think of some other alternatives :)
Well what i did was to use a 87000 records database to solve it, and i seems that VSTS dont the same record if its being used by another VUSER unless there are no more "free" records available, or at least thats what i think, cuz when i set the 87000 on a 100 concurrent users test no errors were returned.
Anyway, im interested on the third solution, i would like to build this plugin, i thougth about it before, but the truth is that i havent use VSTS or Visual Studio for that kind of development. Im interested on Testing plugins, do you know how can i learn more about that?
Any example for the Unique reusable data record test plugin?
Thank you for your answer