Search code examples
azurejmeterjmeter-pluginsoutsystems

JMeter - OutSystems - Login Once Controller


We are testing an OutSystems application sitting on an Azure infrastructure. When performing a recording all of the requests captured are AJAX calls. And not in the traditional HTML format.

I'm trying to set up a scenario whereby if a transaction fails within the main set of transactions (outside of the login and logout), the script restarts from the beginning of the main transactions. The user shouldn't attempt to login again. The current setting for the thread group is "Action to be taken after Sampler error = Start Next Thread Loop". I have added a Only Once Controller, but when a failure occurs, the script stills attempts another login. I have also added the main transactions within a Runtime Controller. That also doesn't work.

JMeter Script

Does anyone have any suggestions please?


Solution

  • I don't know what is "Run Once Controller", there is Once Only Controller which runs its children only for the 1st iteration of the Thread Group

    Demo:

    enter image description here

    In the above demo the Randomly Failing Sampler is a JSR223 Sampler which randomly fails in 50% of cases via the following Groovy code:

    if (org.apache.commons.lang3.RandomUtils.nextInt(0, 10) > 5) {
        SampleResult.setSuccessful(false)
    }
    

    As you can see in case of failure the virtual user:

    1. Goes to the next iteration of the Thread Group
    2. Doesn't execute "Login Sampler", it's being run only once, during the 1st iteration of the Thread Group
    3. Doesn't execute "Always Successful Sampler" because new iteration is started as soon as failure is detected.