Tuesday, February 7, 2012

jmeter: Validate regular expression extractor

I had some extractors in my test, and when I was looking on the request using the extracted values, I noticed that it is not coming correctly. I looked for someway to validate this extractors to see whether I did it correct or not.

First I made sure that I am using the variables correctly in my test

So if the regular expression Reference Name is param1, it should be used as ${param1}

Second, I found that the regular expression can be verified from the “View Results Tree”, so I went to the request, then selected the Response Data tab in the details panel as below

Screenshot-2012-02-07_11.48.58

Then at the bottom, I have entered regular expression in the search box, and checked the Regular exp. check box

at first it wasn’t bringing any results, because there is ? in the regular expression that needs to be escaped

when I changed ? to \?, results was found and highlighted in the response

Screenshot-2012-02-07_11.48.15     Screenshot-2012-02-07_11.48.31

Using this method I was able to verify and correct the regular expressions for the regular expression extractor

No comments:

Post a Comment