Strange missing baseUrl in simulation where it's clearly given.

1,430 views
Skip to first unread message

Kik c

unread,
Dec 13, 2017, 11:50:35 AM12/13/17
to Gatling User Group
I'm seeing a strange issue where I'm getting a "missing baseUrl" error when I have set the url and I can print and show it's set. 

The output looks like this...
the base urls are:
 
+ List(http://localhost:9000)
Simulation BasicSimulation started...
14:26:40.355 [ERROR] i.g.h.a.s.HttpRequestAction - 'httpRequest-1' failed to execute: No protocol.baseUrl defined but provided url is relative :

The first 2 lines are from a println statement. 

The full code snippet is here:

val httpConf = http.baseURL("http://localhost:9000")
println
("the base urls are: \n + " + httpConf.baseUrls)

val scn
= scenario("Hello World") // A scenario is a chain of requests and pauses
 
.exec(http("default_greeting")
 
.get("/greeting")
 
.check(jsonPath("$..greeting").is("Hello, World!"))
)

 setUp
(scn.inject(atOnceUsers(1)))

The build.sbt file looks like this:
enablePlugins(GatlingPlugin)

scalaVersion
:= "2.12.4"

scalacOptions
:= Seq(
 
"-encoding", "UTF-8", "-target:jvm-1.8", "-deprecation",
 
"-feature", "-unchecked", "-language:implicitConversions", "-language:postfixOps")

libraryDependencies
+= "io.gatling.highcharts" % "gatling-charts-highcharts" % "2.3.0" % "test,it"
libraryDependencies
+= "io.gatling" % "gatling-test-framework" % "2.3.0" % "test,it"

Stéphane LANDELLE

unread,
Dec 13, 2017, 12:05:43 PM12/13/17
to gat...@googlegroups.com
Nah, you need to "attach" your HttpProtocol conf to scenarios or setUp: https://gatling.io/docs/2.3/general/simulation_structure/?highlight=protocols#simulation-definitions

Cheers,

Stéphane Landelle
GatlingCorp CEO


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kik c

unread,
Dec 13, 2017, 12:18:53 PM12/13/17
to Gatling User Group
Yep, I knew it would be something small. The rest of my tests were working fine but couldn't find the culprit here. Thanks!!

Cheers,

To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages