I am making a Soap request, and I am receiving the response that's returned as an array:
- [print] [
"M4205N",
"M4206U"
]
For each item in the array, I want to make another Soap request. I've read how you can do this with tables and call a feature file, and I've read how to loop through an array, and call a js function. I cannot figure out how to loop through the array, and pass each value to another soap request xml (one at a time).
I want to do something like this:
- Given soapURL
- And method post
- def responseArray = /xml path for the codes I want/
- def result = call read('otherRequest.feature') responseArray
The otherRequest.feature file would look something like this:
@ignore
Feature:
Background:
* def myNewRequest = read('soap.xml')
Scenario:
Given soapURL
* replace myNewRequest
| token | value |
| @@refNum@@ | responseArrayValue |
When request myNewRequest
And method post
However, I get this error:
GetNewMessageList.feature:27 - argument not json or map for feature call loop array position: 0, M4205N
How can I loop through each item in the array, and pass each value to the other feature file?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…