Unexpected behavior after using extract-regexp to pull Location from response header

44 views
Skip to first unread message

Brian Prusko

unread,
Sep 1, 2017, 1:42:15 PM9/1/17
to codename-taurus
I have a scenario where I am hitting an endpoint to create a new record, and then I am using extract-regexp to pull the URI of the new record from Location in the response header.  I store the URI in a variable and then use in the next step to make a GET call to retrieve the record.  In the Results Tree, I can see that the URL is what I expect it to be; however, the call fails with the following error:  

java.lang.IllegalArgumentException: Host may not be blank
at org.apache.http.util.Args.notBlank(Args.java:74)
at org.apache.http.cookie.CookieOrigin.<init>(CookieOrigin.java:51)
at org.apache.jmeter.protocol.http.control.HC4CookieHandler.getCookiesForUrl(HC4CookieHandler.java:188)
at org.apache.jmeter.protocol.http.control.HC4CookieHandler.getCookieHeaderForURL(HC4CookieHandler.java:138)
at org.apache.jmeter.protocol.http.control.CookieManager.getCookieHeaderForURL(CookieManager.java:350)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.setConnectionCookie(HTTPHC4Impl.java:841)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.setupRequest(HTTPHC4Impl.java:788)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:308)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1146)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1135)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261)
at java.lang.Thread.run(Thread.java:745)

It almost seems like a timing issue where the step tries to execute before evaluating the variable.  Am I missing something? Any help would be greatly appreciated.

Brian Prusko

unread,
Sep 1, 2017, 2:08:44 PM9/1/17
to codename-taurus
This appears to be my mistake.  I don't think I was grabbing enough of the URI.
Reply all
Reply to author
Forward
0 new messages