0
votes

I have scenario as :

While Controller

CSV Data Config
  Switch Controller
    Register_Scenario
       HTTP Request
          HTTP Header Manager
          Regular Expression Extractor
       JDBC Request
          Response Assertion
    Cancel_Scenario
       HTTP Request
          HTTP Header Manager
          Regular Expression Extractor
       JDBC Request
          Response Assertion

View Result Tree

In my CSV I have multiple scenarios to Register and Cancel with different data Eg:

Scenario,Subject,StudentID

Register_Scenario,ABC,1

Cancel_Scenario,XYZ,5

Register_Scenario,MATH,200

I am running Web API and getting the output from Database in one variable(its in Json format in Database), I would like to store that response data coming from JDBC request into the CSV file:

My expected OUTPUT should be:

expected output

Now, I used sample variable in JDBC request in the "Variable names"=Json_Response

I ran the scenario using data mentioned above

I am getting this as output:

Actual output

I believe my result is generating twice as in one scenario I have HTTP request and JDBC request, However variable is defined only on JDBC request and not HTTP request. and for it stays same until value changes..

1

1 Answers

0
votes

If you don't like the null value when your Register_Scenario variable has not been initialized yet you can explicitly set its value to whatever you want (empty or something else) using User Defined Variables configuration element

JMeter User Defined Variables