0
votes

I am having a problem with JMeter. I have a thread group with a web service request and an xpath exctractor. I set the reference name field in the xpath extractor to a user-defined variable that's defined outside the thread group. However, that user-defined variable is never set. I know because any subsequent web service request that references that user-defined variable fails.

Note that this is NOT a problem when I place the user-defined variables within the same thread-group as the web request. Then, the user-defined variable gets set.

How do I work around this bug? I need a way for one thread group to set a user-defined variable through the xpath extractor, so the user-defined variable can be used by another thread group.

1

1 Answers

1
votes

Greetings,

This is actually a feature of Jmeter. (I know..I cringed just writing that). Variables are local to the thread group. The only way to share variable values between threadgroups is to use properties.

There are two functions you'll need to use: ${_setProperty} and ${_property}