Sunil Malgaya wrote:
Dear JMeter experts,
In my output json response I get fully constructed urls (https:\\abc.com\info)
and want to pass on as is to the next request (http sampler). So I
preserved the url in a variable but when I pass this to the next request I
get an invalid url exception because http is already added to the url.
So does anyone know any alternative or option to get this done?
Thanks,
SM
Put the JMeter Variable holding the URL into "Path" field of the HTTP
Request sampler.
Alternatively use JSR223 PreProcessor
<https://jmeter.apache.org/usermanual/component_reference.html#JSR223_PreProcessor>
and split the URL into scheme, host, port and path and populate the
Samplers fields accordingly.
Example Groovy <https://www.blazemeter.com/blog/apache-groovy> code:
def url =new URL(vars.get('put-your-variable-name-here'))
sampler.setProtocol(url.getProtocol())
sampler.setDomain(url.getHost())
sampler.setPath(url.getPath())
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]