Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JMeter - Can I combine 2 user variables into one?

I was wondering if you are able to combine two user variables into one. For example I have one user variable which is defined as the location of a root folder, and a second variable defined as a location from the root, down into a subfolder, and what I'm asking if its possible to put variable 1+variable 2 = a full path way?

so for example I have one variable as:

testData.directory = ${__P(testData.directory,C:\Users\MURPHYA1\Desktop\JMeter bodies)}
testData.testCases = ${__P(testData.testCases,\JMeter Basket body files)    

and what i want to produce is: C:\Users\MURPHYA1\Desktop\JMeter bodies\JMeter Basket body files

Is this possible?

UPDATE

I now have the following config and quite a few test variables just for testing: JMeter Config

like image 382
James King Avatar asked Aug 05 '13 14:08

James King


People also ask

Can JMeter variables be nested?

Note that variables cannot currently be nested; i.e. ${Var${N}} does not work. The __V (variable) function can be used to do this: ${__V(Var${N})}.

How do I pass a variable from one thread to another in JMeter?

Step to implement the logic for passing the variable value to another Thread Group: Add a 'Regular Expression Extractor' post-processor as a child element of 1.1 HTTP Request (Fetcher) and fetch the value in a variable (say employeeID) Add a 'BeanShell Assertion' and write ${__setProperty(valueToPass,${employeeID})}


1 Answers

Add a second "User Defined Variables" element after yours. There every variable will be replaced by the values defined in your first element.

- User Defined Variables
- - test1 = a/
- - test2 = b
- User Defined Variables 2
- - test3 = ${test1}${test2} 
like image 120
Christopher Roscoe Avatar answered Sep 27 '22 21:09

Christopher Roscoe