The problem of comparing rows in a JMeter column

I am trying to use the code below in JMeter BeanShell

I need to compare the value of OldT with ${so_tid_1} , which is an exact string, not a variable

 String OldT = vars.get("OldT"); if (OldT.equals("${so_tid_1}")){ vars.put("OldT","ABCD"); } 

I noticed that the if condition is not met, even if the OldT value is received as ${so_tid_1} . But if I change the condition as if(OldT.equals("some string") , it works fine, and I get the expected result.

Any thoughts on why it is not working?

+5
source share
1 answer

Just do the following:

  String OldT = vars.get("OldT"); // I need to compare the value of OldT // with ${so_tid_1} which is an exact // string and not a variable if (OldT.equals("\${so_tid_1}")){ vars.put("OldT","ABCD"); } 

You need to print the $ sign.

+3
source

All Articles