Fork me on GitHub

Composing test scenarios with GrinderScript.Net

When you arrive at this page you hopefully know a bit about how you write a load test with GrinderScript.Net, and also have an idea of how you'll vary the test data you use to make your test realistic. If you're still not comfortable with these elements of load testing we recommend that you (re)visit the description of how to write load test, or how to vary test data using data pools with GrinderScript.Net before you continue.

Composing test scenarios in GrinderScript.Net is merely a configuration exercise. The first step is to use the ready made ScenarioWorker, by specifiying the property grinderscript-dotnet.workerType=GrinderScript.Net.Core.Framework.ScenarioWorker, GrinderScript.Net.Core. After that you must configure the worker types in the scenario, with their respective load factors. You wrap up your scenario by configuring your global scenario properties, like the need for randomizing the sequence of workers. You find the description of how to do this in the section about properties related to test scenario composition in the description of the GrinderScript.Net properties.

Here is an example of how you can configure a load test scenario in

grinderscript-dotnet.scenarioWorker.1.workerType=GrinderScript.Net.Verifier.Samples.GrinderScript.Net.Datapool.WorkerThatFetchDatapoolValueOnce, GrinderScript.Net.Verifier

grinderscript-dotnet.scenarioWorker.2.workerType=GrinderScript.Net.Verifier.Samples.GrinderScript.Net.Datapool.WorkerThatFetchDatapoolValueBeforeEachRun, GrinderScript.Net.Verifier



In this example the scenario will load and run 9 worker instances, 5 WorkerThatFetchDatapoolValueOnce instances, 3 WorkerThatFetchDatapoolValueBeforeEachRun instances and 1 WorkerThatFetchDatapoolValueBeforeEachTest instance.

They will run in a random order, but the same random sequence will be used each time, since a seed is specified.

What's next

Now you've learned how to compose workers into load test scenarios, you might want to learn how you can run your .cs files as load test scripts without compiling an assembly first.

You can also check out the the complete list of properties used by GrinderScript.Net. Otherwise you should check out how to write load tests with GrinderScript.Net.