Gatling error failed, but actually status 401


I read many articles found in internet and try to find a solution to fix it. But it didn’t work.

Here is my code:
package computerdatabase

import scala.concurrent.duration._

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

import io.gatling.http.request.builder.AbstractHttpRequestBuilder.toActionBuilder
import com.ning.http.client._
import com.ning.http.client.Realm.AuthScheme
import com.ning.http.client.Response
import com.ning.http.client.Realm

class WhiteBoardDosa extends Simulation {

object Viewer {
var viewer = exec(http(“Home”)
.exec(http(“Theatre Booking Barometer”)


object Administration {
val jsonFileFeeder = jsonFile(“adminSimulation_request_location_edit.json”).random
val headers_1 = Map(“Content-Type” → “application/json”)

var admin = exec(http(“Home”)
.exec(http(“Edit Location”)
// .body(RawFileBody(“adminSimulation_request_location_edit.txt”)))

val builder = new AsyncHttpClientConfig.Builder();

val realm = new Realm.RealmBuilder().setUsePreemptiveAuth(true)


val httpProtocol = http
.acceptHeader(""“application/json, text/plain, /”"")
.acceptEncodingHeader(""“gzip, deflate”"")
.userAgentHeader(""“Mozilla/5.0 (Windows NT 6.1; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0"”")

var users = scenario(“Users”).exec(Viewer.viewer)
var admins = scenario(“Admins”).exec(Viewer.viewer, Administration.admin)

users.inject(constantUsersPerSec(40) during(25 seconds) randomized),
admins.inject(constantUsersPerSec(10) during(25 seconds) randomized)


what I do not understand is what setNtlmDomain and setNtlmHost are and how config them correctly.

Thank you adv.


First, NTLM support just got fixed. We’ll be releasing the version with the fix on monday.
Then, there’s now a DSL for NTLM: Note that the version without ntlm domain and host is going away, those are mandatory.

Finally, NTLM domain and host are usually displayed when you log on your computer: domain is the AD zone you belong and host is the name of your workstation.