0
votes

I have debugged and it seems like session id is not passed to my next step so I created a regular expression extractor and tried to use the session id for other requests. When I run my script it gives me following error messages

Syntax used
Referance name =JSESSIONID 
Reg exp=JSESSIONID=([^;]+);
template=$1$
match no=1

java.net.URISyntaxException: Illegal character in path at index 49: http://eproglb/eProgesa/LoginServlet;jsessionid=${JESSIONID};; at java.net.URI$Parser.fail(Unknown Source) at java.net.URI$Parser.checkChars(Unknown Source) at java.net.URI$Parser.parseHierarchical(Unknown Source) at java.net.URI$Parser.parse(Unknown Source) at java.net.URI.(Unknown Source) at java.net.URL.toURI(Unknown Source) at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:286) 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(Unknown Source)

1

1 Answers

0
votes

Your regular expression seems fine, but it is quite hard to say what could be wrong without seeing response and screenshot of your test plan.

In the meantime you can consider alternative approach. JSESSIONID is basically a cookie hence it can be automatically handled via HTTP Cookie Manager.

In case if you need explicitly set JSESSIONID cookie value somewhere you can get it from the aforementioned HTTP Cookie Manager using next few steps:

  1. Add HTTP Cookie Manager to your Test Plan
  2. Add the following line to user.properties file (located under /bin folder of your JMeter installation):

    CookieManager.save.cookies=true
    
  3. Restart JMeter (restart is required to pick the property up)
  4. Access JSESSIONID cookie value as ${COOKIE_JSESSIONID} where required.