TomH
TomH

Reputation: 127

Set step load pattern via command line for Visual Studio Load Test

I have a solution where I am running various load test scenarios via the command line for Visual Studio 2017. I know I can use MSTest to do this, and am using /testcontainer arg for picking which .loadtest file, and the Set Test.UseRunSetting= WhateverRunSetting arg to pick which run setting I want (controller duration, context parameters, etc).

I can't seem to find a way to change the Step Load Pattern from command line, however. This would allow me to, from the command line, set things like ramp up time, max users, initial users, and other flags. The other way I can think to do this is if I can say which scenario to run (instead of all scenarios in the .loadtest file) based on a command line arg.

Upvotes: 0

Views: 180

Answers (2)

Heaven Lalpuriya
Heaven Lalpuriya

Reputation: 21

Another way to do this is use of plug-ins. You can create a plug-in in your load test. The plug-in will read the external excel or xml file to control the user load. You can modify the excel or xml through automation. I have same thought as yours for modifying load test files externally. Never thried though.

Upvotes: 0

TomH
TomH

Reputation: 127

Well, the route I used was to write a Powershell script that accepts the parameters I want, such as initial users, step duration/ramp time, context parameters, max users, etc. Then takes those and edits my .loadtest file (since it's an XML file) and saves the .loadtest with the edits, including setting it as the active run-setting.

Then using MSTest as noted above, I can make sure that run setting and .loadtest is used and kick off my test(s).

Upvotes: 1

Related Questions