Removing slash in Jmeter and passing the value to next api

Viewed 11

From csv confi i am passing a variable for encryption Api that is "analytical_url":"api\/apply_weekoff"

i need to replace \/ with empty from "api/apply_weekoff" on passing to encryption api

any suggestion

1 Answers

If you have this value stored in a JMeter Variable you can use __groovy() function like:

${__groovy(vars.get('foo').replace('\\\\'\, ''),)}

enter image description here

The above code line assumes that you have foo JMeter Variable with the value of "analytical_url":"api\/apply_weekoff"

Alternatively you can use __strReplace() function like:

${__strReplace(${foo},\\\\,,)}

enter image description here

__strReplace() function is not present in default JMeter distribution bundle you will need to install it additionally using JMeter Plugins Manager

Related