0
  1. I am performing load testing using jmeter. I created a test plan with https request and used regular expression extractor to extract variable returned from first https request.

Variable: csrftoken
Regular Expression: value="(.*)"
Template: $1$
Match Number: 1
Default Value: EMPTY

2.Used JSR223 Postprocessor and verified that the extracted variable are correct.

log.info("***************************"+vars.get("csrftoken"));
  1. I Created new test plan for signin request were I'm using the variable which was extracted in first test plan and defining the variable in parameters as

csrfmiddlewaretoken : ${csrftoken}
email : xxxxxxxx@gmail.com
password : Password

But ${csrftoken} variable are not getting picked up when I run the request.

Is there any other possible way to make use of variable from one test plan to other test plan and run the request with the same variable.
Help would be really appreciated!!
Thanks in advance.

manju k
  • 11
  • 6

1 Answers1

0

What do you mean by "test plan", if you referring to this Test Plan and want to pass the value between 2 separate .jmx test scripts - the only way to do it is to write the CSRF token(s) into a file using i.e. Flexible File Writer in one test plan and read it back using CSV Data Set Config in another test plan

As per JMeter Documentation on variables, Variables are local to a thread to you cannot access a JMeter Variable anywhere but within the bounds of single thread (virtual user) context, you cannot even access it in the different Thread Group, not talking about different test plans.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133