1

Sorry if my question gets a bit confusing. I will try my best to explain the situation, and it might be a stupid question as well. (Sorry in both cases)

So, I have a JMETER script where I have to authorize the request using CMS URL(HTTP Sampler). To create the Signature, I need the PATH (URI Path) from my HTTP Request Sampler. If it was only one sampler, I could have hardcoded it, but I have more than fifteen HTTP Samplers where I have to use CMS Authentication.

My question is: Is there a way I could use the $PATH from each sampler in a BeanShell Preprocessor and create an Authorization Signature and then add it to the HeaderManager? Sorry if it got confusing, but any help would be really great. Thanks in advance!!!

0

1 Answer 1

0

In case of HTTP Request sampler it would be sampler.getPath()

See HTTPSamplerProxy JavaDoc for information on methods and fields available and How to Use BeanShell: JMeter's Favorite Built-in Component for more information on using JMeter and Java API from scripting test elements.

Sign up to request clarification or add additional context in comments.

1 Comment

Awesome! It worked. :) Thank You :) sampler.PATH prints HTTPSampler.path, and sampler.getPath() printed exactly what I needed. Thanks again!!! How do I mark it as answer?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.