Hoping someone can make sense for me of how ScenarioBuilder works with ChainBuilder.
I have two “scenarios” each sending a json body to an api endpoint.
My end goal is to have a scenario file of many individual requests (scenarios) and then chain them together with ScenarioBuilder and run as a new scenario of multiple requests.
However, i’m having an issue where it won’t run the second scenario, example above, it will run the createCustomer scenario but ignore the updateCustomer scenario.
I could achieve the same outcome by putting both requests together via ChainBuilder in my scenario file, but I feel like that compromises the DRY principle.
ok but in this example you have search, browse and edit which are 3 separate requests. I want to do the same as this, but in my case it only injects the first request, and doesn’t bother with the second.
search, browse and edit which are 3 separate requests
search, browse and edit and 3 chains. You’re confusing the terms scenarios, chains and requests, so it’s hard to follow.
In your original message, the create defined in ScenarioBuilder create = scenario("Create customer").exec(createCustomer); is never used anywhere, in particular in the setUp, and hence does nothing.
Sorry bad example, this is an example of two different scenarios i want to run, so I’d edit the setUp to include create when i only want to run create and then change it to update when i want it to run createCustomer and updateCustomer.
However, i’m having an issue where it won’t run the second scenario, example above, it will run the createCustomer scenario but ignore the updateCustomer scenario.
How did you reach this conclusion? Because it should work. Can you share your logs?
Note: you really should use jmesPath checks instead of regex for parsing JSON payloads.
What can be wrong:
Using duration in ChainBuilder make a loop of calls for this one chain and after that it’s called another chain and there is another loop of calls.
If you want to achieve one chain and another one after first and same thing again in loop:
Thank you for your reply, that helps with the two scenarios running concurrently and behaves as expected, however by using constantUsersPerSec how do I define a ramp and test duration? I’'ve typically used rampUsers and a ramp duration in the past, and occasionally used throttle.
In you question you say about issue with concurrent scenarios so example show where can be bug and how to fix it. If it help set as Solution my previous message.
this was only example, you must prepare Injection as you need.
Yeah i’ve referred to the documentation a lot but I find it difficult to understand the code examples when everything is bundled together, real-world examples, or samples are what my brain tends to understands, I came from LoadRunner so I’m after LoadRunner simplicity levels of run-time settings, i’ll keep experimenting.