Issue with using csv feed. Getting an error value feed is not a member of io.gatling.http.request.builder.Http

1,487 views
Skip to first unread message

Sivaraman V

unread,
Jun 12, 2017, 9:56:30 AM6/12/17
to Gatling User Group
Hi,

I am trying to execute the below script and getting an erro that the csv feed is not a member of  io.gatling.http.request.builder.Http

The script is given below:

package com.oos.loadtesting


import scala.concurrent.duration._


import io.gatling.core.Predef._
import io.gatling.http.Predef._
import io.gatling.jdbc.Predef._




class RecordedSimulation extends Simulation {


 val httpProtocol
= http
 
.baseURL("http://172.16.177.111")
 
.inferHtmlResources()
 
.acceptEncodingHeader("gzip,deflate")
 
.contentTypeHeader("""application/soap+xml;charset=UTF-8;action="http://service.tib.oos.com/findAddress"""")
 
.userAgentHeader("Apache-HttpClient/4.1.1 (java 1.5)")






    val uri1
= "http://172.16.177.111/services/FindAddressPort"
 val
Feeder = csv("Address-GNAFID.csv")


 val scn
= scenario("RecordedSimulation")
 
.exec(http("request_0")
 
.feed(Feeder))
 
.post("//services/FindAddressPort")
 
.body(bodyString(s"""<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:fin="http://interface.commoti.oos.com/1.0/extn/findAddress" xmlns:com="http://www.oos.com/yard/odm/1.1/Common" xmlns:tib="http://data.types.commoti.oos.com/1.1/TibContract" xmlns:cus="http://www.oos.com/yard/odm/1.1/Custom" xmlns:aus="http://www.oos.com/AustralianAddress"><soap:Header/><soap:Body><fin:FindAddressRequest><com:interactionID>${InteractionID}</com:interactionID><com:interactionDate>2016-06-07T21:32:52.12679</com:interactionDate><com:interactionAction>GNAFID</com:interactionAction><com:SourceApplicationID>vbn</com:SourceApplicationID><com:serviceName>findAddress</com:serviceName><com:triggeredBy>dcad</com:triggeredBy><com:channel>CSA</com:channel><com:opID>HOB</com:opID><com:buID>DEFAULT</com:buID><tib:requestMode>RR</tib:requestMode><fin:AustralianAddress><aus:ID>${LocationID}</aus:ID></fin:AustralianAddress></fin:FindAddressRequest></soap:Body></soap:Envelope>""")))


 setUp
(scn.inject(atOnceUsers(1))).protocols(httpProtocol)
}

Error:

19:16:06.056 [ERROR] i.g.c.ZincCompiler$ - D:\app\gatling-charts-highcharts-bundle-2.2.5\user-files\simulations\com\oos\loadtesting\RecordedSimulation.scala:27: value feed is not a member of io.gatling.http.request.builder.Http
possible cause
: maybe a semicolon is missing before `value feed'?
19:16:06.062 [ERROR] i.g.c.ZincCompiler$ -                      .feed(csv("Address-GNAFID.csv"))
19:16:06.068 [ERROR] i.g.c.ZincCompiler$ -                       ^


Can you please help to know what is wrong here?

CyberNinja

unread,
Jun 13, 2017, 1:52:31 AM6/13/17
to Gatling User Group
A feeder cannot be fed to the HTTP request. Move it outside like this

 val scn = scenario("RecordedSimulation")
 .feed(Feeder)
 .exec(http("request_0")
 .post("//services/FindAddressPort")
 .
 .
 )

Craz1Cadr1ca

unread,
Feb 20, 2018, 7:14:05 AM2/20/18
to Gatling User Group
So how is the examples working then? (unless they are not) https://gatling.io/docs/2.3/advanced_tutorial/

CyberNinja

unread,
Feb 20, 2018, 7:56:37 AM2/20/18
to Gatling User Group
Are you referring to the following example mentioned here -> https://gatling.io/docs/2.3/advanced_tutorial/#step-03-use-dynamic-data-with-feeders-and-checks?

The feeder is attached to the exec method, not to the HTTP request.
  val search = exec(http("Home")
    .get("/"))
    .pause(1)
    .feed(feeder) // 3
    .exec(http("Search")
    .get("/computers?f=${searchCriterion}") // 4
    .check(css("a:contains('${searchComputerName}')", "href").saveAs("computerURL"))) // 5
    .pause(1)
    .exec(http("Select")
    .get("${computerURL}")) // 6
    .pause(1)

Craz1Cadr1ca

unread,
Feb 20, 2018, 11:52:10 AM2/20/18
to Gatling User Group
Ow.. that sneaky bracket on the second row... fooled me
Reply all
Reply to author
Forward
0 new messages