Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parallel execution of multiple scenarios

Tags:

gatling

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))    )  } 
like image 362
Hans Holzbart Avatar asked Dec 05 '16 08:12

Hans Holzbart


People also ask

What is parallel execution?

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.

Can we run Cucumber scenarios in parallel?

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.

How do you run multiple scenarios in a single feature file?

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.

How do I run multiple features parallel in cucumber?

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.


1 Answers

Whatever you are doing is absolutely fine.

The way you are running the setup you will see that the requests are running in parallel.

like image 95
Pritam Banerjee Avatar answered Sep 29 '22 04:09

Pritam Banerjee