How to use xml data stored by saveAs option in gatling -


one of gatling request returning xml data. have pass subset of xml response body of next request.

i fetched saved xml subset this: .check(xpath("metadata/metadata1/metadata2").saveas("config")

now xml data stored in string format.

next request's body part expecting data in xml format only. tried below this: .body(stringbody("""${config}"""))

but xml data not getting passed here.

what wrong? there other better way xml response , pass it's subset body of next request.

xml format that's complex complicated provide generic solution you're trying do. it's not copying part of tree: namespaces?

so basically, can't current xpath support in gatling.

i see following possible solutions:

  1. use regular expression.
  2. capture values you're interested in separately xpath, save them, , use them build request body template. solution not generic though.
  3. if you're proficient xml apis, can use bodystring check, , parse in transform step.

Comments