How execute different url with different headers?

I have a test scenario like this:
request 3 different url as load balance, and every url must with a different header.
How could I do this? Thank you.


val httpProtocol = http.baseURLs(

  val headers_1 = Map("X-Auth-Token" -> "AUTH_tkc3b4bbc0b8384a25b8f1ba03409893f2")
  val headers_2 = Map("X-Auth-Token" -> "AUTH_tkd998f7ce72e94f52bb03e93e2d7cf152")
         val headers_3 = Map("X-Auth-Token" -> "AUTH_tk88fd3003d5804d39af58b37d9d774251")

         val scn1 = scenario("swift")
          .repeat(3) {

scn1.inject(atOnce(1 user))    

Are you sure that your X-Auth-Token can be replayed like you do?

The round robin with multiple baseUrls is too simple for this.

If you want individual users to reach several IPs, you’ll have to use absolute URIs and use a switch:

If you’re fine with individual users only reaching a single IP each (session affinity), you’ll have to either:

  • use different scenarios (you can reuse chains/parts of a scenario, you don’t have to duplicate everything).

  • or inject different populations, configured with different protocols (if you can set your header at protocol header, it will be send on every request)


RandomSwitch is ok, It pretty work. Thank you.

在 2013年12月31日星期二UTC+8下午11时56分53秒,Stéphane Landelle写道: