views:

21

answers:

1

Hi. I've searched on Google for an answer to this but there doesn't seem to be much information out there. Does anyone know if you can use WCAT and or TinyGet to test an asp.net application that uses HttpHandlers? I've tried both of these tools and I'm getting an Internal Server Error 500. Looks like a problem with the HttpContext?

[NullReferenceException: Object reference not set to an instance of an object.]
   BCT.BaseHttpHandler.Process(HttpContextBase context) +622
   BCT.UADTimeHttpHandler.Process(HttpContextBase context) +55
   BCT.BaseHttpHandler.ProcessRequest(HttpContext context) +75
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep
.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& comp
letedSynchronously) +75

I've also tried using the WCAT Fiddler plugin but that has a different error about a possible missing reg key.

+1  A: 

Definitely you can. WCAT just makes HTTP requests, exactly like any browser. You've got a bug in your handler, is all. What does the code that the stack trace points to say, here:

BCT.BaseHttpHandler.Process(HttpContextBase context) +622 

?

Scott Stafford
Hi. Thanks for putting me on the right track. I suppose it's a bug by design. I check the user agent and if it's not what I am looking for then I abort the request and return a custom http status of 600. So not exactly sure why it's interpreting it as a 500? So to get it to work I commented out the user agent checking code. Do you know if you can set the user agent string? Thanks!
Matt
@Matt: Sure you can, add this to your config file: setheader { name = "User-Agent"; value = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0"; } (http://blogs.iis.net/mukhtard/archive/2009/04/02/sample-wcat-script-files.aspx)
Scott Stafford
That's great. Thanks!
Matt