Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to parameterize the "Variable Condition" field in the "TestFlowLogic" of "Execution Options" tab

Options
varun450
varun450 Posts: 3

I want to parameterize the Variable Condition field present inside Scenario >> Execution Options >> Test Flow Logic >> Variable Condition. I want to take the value from "Environments" or "Data Sources". The traditional way of specifying "${some_variablename}" is NOT working

Answers

  • jakubiak
    jakubiak Posts: 798 admin
    Options

    The "Variable Condition" field does not currently support parameterization. However there is another way to do this. Instead of parameterizing the variable condition, you could instead set the variable condition to the value "true", and then in an Extension Tool at the beginning of your test scenario you could set the value of the variable based on an environment variable. When you want the test to run you set the variable to "true", and when you don't want the test to run you set the variable to "false". Here is example Groovy code you can put into an Extension Tool that will do this:

    import com.parasoft.api.*;
    
    public void setVariables(Object input, ScriptingContext context) {
        String envVarValue = context.getEnvironmentVariableValue("shouldRun");
        context.setValue("shouldRunVar", envVarValue)
    }
    
  • BastiaantB
    BastiaantB Posts: 8
    Options

    You can do that by using the same name for the datasource variable and the variable used in the condition