What ist the best practice for parallel execution of multiple scenarios? For example 30% Users execute scenario1 and 70% users scenario2.
Is the code below the right way or is it better to have one scenario with contional executions of REST calls?
class MySimulation extends Simulation { val userIdsData = csv(userIdsCSV).queue ... val scenario1 = scenario("Scenario 1") .feed(userIdsData) .get(...) val scenario2 = scenario("Scenario 2") .feed(userIdsData) .get(...) .post(...) setUp(scenario1.inject(rampUsers(30) over (ramp seconds)) .protocols(HttpConfig.value(baseURL)), scenario2.inject(rampUsers(70) over (ramp seconds)) .protocols(HttpConfig.value(baseURL)) ) }
Parallel execution is the ability to apply multiple CPU and I/O resources to the execution of a single database operation. It dramatically reduces response time for data-intensive operations on large databases typically associated with decision support systems (DSS) and data warehouses.
Cucumber can be executed in parallel using TestNG and Maven test execution plugins by setting the dataprovider parallel option to true. In TestNG the scenarios and rows in a scenario outline are executed in multiple threads. One can use either Maven Surefire or Failsafe plugin for executing the runners.
We can write all possible Scenarios of a particular feature in a feature file. By using the keyword "Scenario" or "Scenario Outline", One Scenario can be separated from another. However, a single feature file can contain any number of scenarios but focuses only on one feature such as registration, login etc at a time.
Cucumber can be executed in parallel using JUnit and Maven test execution plugins. In JUnit, the feature files are run in parallel rather than scenarios, which means all the scenarios in a feature file will be executed by the same thread. You can use either Maven Surefire or Failsafe plugin to execute the runner.
Whatever you are doing is absolutely fine.
The way you are running the setup you will see that the requests are running in parallel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With