Use case scenario with Active vu's and actual vu's performing tests

I have a user scenario which I need to setup:

I want one set of vu’s(say 100) to login and be idle*(can be refered as Active in the application, but not perfoming any action)*
Then another set of vu’s(say 50, which will always be subset of vu’s used in first case), to perform all other application operations defined.
This test should run for a defined duration of time then all the vu’s used in first case and second case should get terminated.

Currently the way I set is I have two scripts: Login.js and user-flow.js
I defined these scripts in exec field for two different scenarios as ‘login.scenario’ and ‘userFlow.scenario’

my entire scenario looks like:

"active_load_test": {
        "login": {
            "executor": "constant-vus",
            "vus": 100,
            "duration": "2h",
            "exec": "login"
        "userFlow": {
            "executor": "ramping-vus",
            "stages": [
                    "target": 50,
                    "duration": "10m"
                    "target": 50,
                    "duration": "2h"
            "gracefulRampDown": "10m",
            "exec": "user-flow"

also in login.js , i specified this piece of code at last

if(__ENV.exec == 'active_load_test'){
        if( == 'login'){
            if((exec.instance.currentTestRunDuration/1000) >= parseInt(exec.test.options.scenarios.userFlow.stages[0].duration)){

I am not sure if this is the right approach for my use case.
Can you please help in defining best approach possible according to my usecase.

This does not sound like the correct approach. I would start with a scenario that uses the fixed-iterations executor and have that execute it’s 100 iterations, and then go on to the user flow.

In general, your approach seems a bit overcomplicated. It would be easier to provide you with some assistance if you posted more of your actual script(s).

1 Like