I have a requirement to execute my xml payload over set of data. So I would like to feed data set from csv and that’s where I need some assistance. I have attached the code below. Any inputs would be highly appreciated!
My data file - test.csv is stored under src/test/resources/data. It got only one column for now -“eff_date”
Scala code: (it’s not the full code but the code for object where I am feeding the data from csv)
`
class FXISimulation extends Simulation {
val httpProtocol = http
.baseUrl(“https://abc.com”) // Here is the root for all relative URLs
val header = Map(
“Content-Type” → “application/soap+xml;charset=UTF-8”,
“Connection” → “alive”,
“User-agent” → “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0”)
val data = csv(“test.csv”).circular
object payload_myUHC{
val pl1 = scenario(“pl1test”).feed(data).exec(http(“myUHC_dentalbenefitsandaccums”)
.post(“xyz”)
.headers(header)
.body(StringBody("""<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap=“http://abc.org/”>
soap:Header/
soap:Body
tem:Execute
tem:pcsRequest<![CDATA[
Facets
FXIGUESTM
HealthWeb
12345
14:20
ePlan
scs_benefit
InvokeSPUnaware
fakpfpr0fxi
scs
A10000
**"${eff_date}"<****/Column>**
*
0
Y
123000
]]></tem:pcsRequest>
</tem:Execute>
<tem1:Execute xmlns:tem1=“http://tempuri.org/”/></soap:Body>
</soap:Envelope>""")))}
`
Error Details: I am sure I must be missing something above the way I am using data from csv. I am getting the following error
14:27:36.635 [WARN ] i.g.h.e.r.DefaultStatsProcessor - Request ‘myUHC_dentalbenefitsandaccums’ failed for user 291: status.find.in(200,201,202,203,204,205,206,207,208,209,304), found 500