tags:

views:

48

answers:

1

Someone provided me the regex to parse out a query string: (?<=\?)[^?]+$

I am trying to use that in JMeter with no luck (although I am successful in pulling out individual query string parameter values based on various example postings on the web).

  • I created a regular expression extractor called "Grab QueryString".
  • I selected the URL response field to check.
  • For the reference name, I typed "myQueryString".
  • For the regular expression, I entered your text.
  • For template, I entered $1$
  • Match no = 1
  • Default Value = ERROR

Unfortunately, "myQueryString" is getting populated with ERROR and not the URL query string as hoped when I try and use it as a parameter in a future GET.

Thus, I see this in the "View Results Tree":

https:/www.website.com/folder/page.aspx?ERROR

Instead of:

https:/www.website.com/folder/page.aspx?jfhjHSDjgdjhsjhsdhjSJHWed

Did I do something wrong? Anyone have any suggestions?

A: 
  1. Is the QueryString supplied in the URL, or is it in the body of the page?
  2. Have you verified your regex works outside Jmeter? Use a program like "Regex Coach" and you can run the regex expression against the source code to verify it finds what you're looking for.

You have the variable reference setup correctly, or you wouldn't see "ERROR" in the url.

BlackGaff