JMeter - Can I merge 2 user variables into one?

I was wondering if you can combine two user variables into one. For example, I have one user variable, which is defined as the location of the root folder, and the second variable, defined as the location from the root, down to the subfolder and what I ask, is it possible to put variable 1 + variable 2 = full path path?

so, for example, I have one variable like:

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 create: C: \ Users \ MURPHYA1 \ Desktop \ JMeter body \ JMeter Basket body files

Is it possible?

UPDATE

Now I have the following configuration and quite a few test variables for testing: JMeter configuration

+4
source share
6 answers

Add the second "User Defined Variables" element after yours. There, each 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} 
+8
source

You can create a user-defined variable named test and value:

  • $ {testData.directory} $ {testData.testCases}

And then use: $ {__ evalVar (test)} in place

It is also better to use / instead of \ for properties and path variables, since they will work on both Linux and Windows.

0
source

I could not combine 2 variables into one of jmeter. I tried several approaches, but in the rest of the test plan, I used two variables side by side .: - (

0
source

For example, you have two variables:

  • Variable from Regular Extractor: ${employeeID}
  • The second variable is a simple variable defined in user variables: Test1 = ${__Random(14,25,)}

  • Now we merge / merge these 2 variables, it will look like this:

    $ {__ B (EmployeeID _ $ {test1})} $ {employeeID} + $ {Test1} = $ {__ V (employeeID _ $ {Test1})}

__ Function V

0
source

try it

$ {__ In ($ {keyword1} $ {keyword2})}

0
source

BeanShell Prozessor:

 String var1 = vars.get("var1"); String var2 = vars.get("var2"); vars.put("var3", var1+"."+var2); 
0
source

Source: https://habr.com/ru/post/1495335/


All Articles