The system variables passed to java class doesnt work in gatling simulation

4 views
Skip to first unread message

Sanhita bs

unread,
Jul 6, 2018, 5:01:05 PM7/6/18
to Maven and Scala
Hi,

I have the following simulation class in gatling:

class BasicSimulation extends Simulation {

    var p= new SmokeTest();
    println(p.extractDeployerURI())
 
    .baseURL(p.extractfunction())  // Here is the root for all relative URLs
    .acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") // Here are the common headers
    .acceptEncodingHeader("gzip, deflate")
    .acceptLanguageHeader("en-US,en;q=0.5")
    .userAgentHeader("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0")
.
.
.}

The extractfunction() is a method in a java class which extracts System variables and provides the base url as the output(which is a string). when the extractfunction() is run as a integration test, it passes. But it fails when called via the Simulation class. 

Anybody who knows what can be done to solve this??

Thanks,
Sanhita
Reply all
Reply to author
Forward
0 new messages