Sometimes, you just want a simple test page on IIS to do some automated testing of your code that interacts with IIS. Here is another useful one in the series.
Hi,
I have some negative testing therefore need to have IIS to return 403, 404 or 500. How can I configure each? An automated way would be the best but manual is OK too.
Thanks,
There are a couple of approaches to do this. You can either:
The former can be accomplished in the following manner:
The latter is easier to configure/use and is shown as a code sample at the end of this blog entry. You just need to copy the ASP page to IIS, make sure ASP is enabled, and make a request to that ASP page with the correct querystring parameter. i.e.
/ResponseStatus.asp?status=403%20Test!
//David
<% DIM status status = Request.QueryString( "status" ) IF NOT IsEmpty( status ) THEN Response.Status = status END IF %>