是的,你可以。
Using a scenario allows us to generate multiple request, only changing certain values.
!*> Scenario definition
!define POST_BODY_2 { {{{
<s11:Envelope xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/">
<s11:Body>
<ns1:GetCityWeatherByZIP xmlns:ns1="http://ws.cdyne.com/WeatherWS/">
<ns1:ZIP>@{zip}</ns1:ZIP>
</ns1:GetCityWeatherByZIP>
</s11:Body>
</s11:Envelope>
}}} }
|script|xml http test|
|table template |send request |
|post |${POST_BODY_2} |to |${URL} |
|check |response status|200 |
|show |response |
|register prefix|weather |for namespace|http://ws.cdyne.com/WeatherWS/|
|$City= |xPath |//weather:City/text() |
*!
|send request |
|zip |City? |
|10007|New York |
|94102|San Francisco|
在本例中,变量
zip
因此请求与10007或94102一起发送。