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)
}
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$ - ^
.post("//services/FindAddressPort")
.
.)
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)