0
votes

I'm just getting started with JMeter and have run into a problem. I'm using the Regular Expression Extractor to scrape and parameterize a string that I named CouponID, as follows:

"coupon_id":”(.+?)” (from the following json response "coupon_id":"320747")

enter image description here

But when I plug the variable (${CouponID}) in the value field of a parameter in the subsequent http request, its request URL ends up looking like this and the test fails:

http://[...]/coupon.json?id=${CouponID}  (instead of [...]/coupon.json?id=320747)

When I include a valid default value, the URL is constructed correctly and the test passes.

Please advise.

1

1 Answers

0
votes

Try using this instead.

(?<=\"coupon_id":")(.*?)(?=\")

Preview: http://imgur.com/6F5Lk0X