I know how to set the number of iterations and the number of users while doing web test/ load test in Visual Studio. But how can i set these dynamically via code. As a tester I just want to go and change the numbers in the code and just run the tests and not have to go to the edit options.
Say suppose I have an website to buy a phone. Iterations(Performance test)would be buying the phone for (say) 100 times. Increase in the number of users(load test) would be increase in the number of users buying the phone at the same time. A prime scenario for testing would be (say) 100 users buying the phone each 10 times, so a total of 100x10 times. Now in VS2015 I know how to go and edit the options in Visual Studio and change the numbers for Performance test and the load tests as mentioned in this link: https://learn.microsoft.com/en-us/vsts/load-test/run-performance-tests-app-before-release#createload. But I would like to do it programatically. I want to set the number of users and the number of times each user can buy the phone,through code.For instance,when I run the tests a cmd prompt is triggered,asking for 2 inputs, one: the number of the users that I want to test with and two: the number of times that each user can buy.The user enters both the inputs and then the test runs with the given number of users and iterations.
For example,this is just like setting an environment variable. A user can go to the machine properties and set the required environment variable manually. But he can also just write a small batch file and run it, which sets the required environmental variable.