help in storing a value and calling a variable in jmeter request using regular extractor -


my soap/xml response looks below:

<account><accountnumber>1234<description>savings</account><account><accountnumber>1235<description>savings1</account> 

i store accountnumbers in variable or array , call in soap xml request in jmeter knowing details. can me how can store , how can call variable ? new jmeter.

thanks in advance.

if account numbers static, you're better off using .csv file, mentioned vance because csv data reader has less overhead regex.

however, if want dynamic data, it's easy do.

  1. download "regex coach" write regular expressions. it's amazing tool.
  2. attach "regular expression extractor" child soap/xml request
  3. run request once, reponse
  4. copy response regex coach (or whatever tool use), , write regex. it'll this: (\d+?)\d (look digit after text accountnumber , stop after non-digit)
  5. configure rest of regex. in case, you'll want:

    • apply to: main sample
    • response filed check: main body
    • reference name: variablename
    • regular expression: see step 3
    • match no: 1 (1st match) 0 (any match) or -1 (all matches, useful when doing "for each found" logic
    • default value: failed
  6. to use variable account number in other requests, use reference name. in example: ${variablename}

reference: http://jmeter.apache.org/usermanual/component_reference.html#regular_expression_extractor


Comments