Unexpected HTTP Status Codes using WCAT with NTLM
Does anyone know how to avoid WCAT recording unexpected "401 Unauthorized" HTTP Status codes when testing a web application that uses NTLM authentication? An example of the code I am using for a request is below:
request
{
url = "http://server";
authentication = NTLM;
username = "user";
password = "xxxx";
statuscode = 200;
}
To clarify, this script works fine and does manage to retrieve the content but when ran against an IIS7 server the NTLM negotiation (I believe) means that the initial 401 code is recorded as well as the final 200 code.
This means that after a test the report shows the same amount of 401 codes as 200 codes, and unfortunately the 401s are recorded as unexpected codes/errors.
I realise this is a similar question to one asked earlier, but this one is specifically asking if there is a way to av开发者_如何学JAVAoid the unexpected status codes.
Thanks!
What you need (I think) is a transaction { ... }
with a number of request { ... }
elements inside, some of which expect a 401 statuscode:
transaction
{
id = "home";
weight = 1000;
request
{
url = "/";
statuscode = 401;
redirect = true;
cookies = true;
}
request
{
url = "/";
statuscode = 401;
authentication = NTLM;
username = "domain\\username";
password = "password";
redirect = true;
cookies = true;
}
request
{
url = "/";
authentication = NTLM;
username = "domain\\username";
password = "password";
statuscode = 200;
redirect = true;
cookies = true;
}
}
精彩评论