0

I have to record a large test plan including 4 transactional controllers and response assertions for the UI side but at the time of login there is token generated and I am doing correlation manually.

I have used the regular expression extractor to extract the token from my login response but it gives the following error:

org.apache.oro.text.MalformedCachePatternException: Invalid expression: (?<=("|')token("|'):("|'))(.*?)("|')(=?) Sequence (?<...) not recognized.

Please guide me also how can testplanI pass this TOKEN on the further request as each request has its own header manager. How I can pass THIS TOKEN OVER 4 TRANSACTIONAL CONTROLLER. I am adding my test plan for reference. Please guide me on a suitable process to do this.

1 Answer 1

1

The exception clearly states that Sequence (?<...) not recognized

As per jmeter documentation https://jmeter.apache.org/usermanual/regular_expressions.html, Lookbehind expression (?<=) is not supported.

enter image description here

So use:

("|')token("|'):("|')(.*?)("|')

Here we have 5 groups, the actual token is in the 4th group and to get just the token value set template field as: $4$

enter image description here

5
  • Thanks, it works
    – coder_m
    Commented Dec 15, 2019 at 4:39
  • @coder_m please accept the answer and upvote. Just click up arrow and tick
    – PDHide
    Commented Dec 15, 2019 at 10:47
  • Can you bit help me out t, how do I pass this extracted token in further requests as it is testing of UI side and there are a lot of HTTP requests recorded with their header manager so I have to pass this request in all subsequent requests and by adding just one header manager over the controller does not do the work. it gives 401 unathorized
    – coder_m
    Commented Dec 15, 2019 at 13:50
  • blogs.quovantis.com/…
    – PDHide
    Commented Dec 15, 2019 at 14:23
  • See if this help , I am not sure about other answers has haven't worked much on it
    – PDHide
    Commented Dec 15, 2019 at 14:29

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.