Asp Unit

I found a test suite that is pretty basic but in about 10 minutes I was able to edit it to do some cool stuff. It is based off of xUnit and looks very similar in architecture to JUnit, but it is done in VBScript. It's at http://aspunit.sourceforge.net/ I think it's mentioned earlier, but here is the address. -- Michael Rasmussen


Try XmlTestSuite; this tests the ASP pages using http requests. You can test for specific tags in the HTML response, and, for database driven sites, you can also test and monitor relevant database tables. The tests and test data are written in XML.

I helped to develop this open source application, and I have used it for both ASP and cold fusion pages.

-- DavidRutter


Ok. The people below seem to be relying on ComObjects? for their UnitTests. However, some of us are hired to do large amounts of work in an environment where we don't control the server, and aren't allowed to register our own ComObjects?. So, given those constraints, how does one do ASP UnitTests.

You could write a specialized UnitTest framework in script. See OoAspPractices. -- DrewMarsh

Check out ASPUnit over at SourceForge -- Adrian Edwards


We're currently working on an architecture to do this. It consists of an in-house ComUnit infrastructure where a specific ASP UnitTest component exists for executing an configured ActiveServerPage and getting back a result in XML. The XML is then translated and propagated into the ComUnit architecture by the aforementioned component.

More details when they become available.

-- DrewMarsh


We avoid putting code in the ASP and push it down into COM objects. Testing COM objects is much easier (from VB). Also there is a gotcha with ASP; if it loads a COM object, it keeps the object reference until PWS (or IIS) is stopped. Meaning you can't rebuild the COM object and retest the ASP page without stopping and restarting PWS. What a pain! -- IanRae

That's fine, but how do you test collection and data-scrubbing from an HTML form? Do you put all that logic into a component? -- DrewMarsh

All I want is LITE, COM-free testing of server-side JavaScript objects. The various syntaxes that #include source files between the various ASP, HTML, JS or WSF formats have screwed me. I must either "manually include" the testee by reading it as a file and running eval() on it, or I must promote my lowly JavaScript into a COM object using WSC, and then risk the COM bugs listed above. What a pain! Click here to read more whining:

http://www.deja.com/threadmsg_md.xp?AN=644826719
And here for the solution:
http://www.deja.com/threadmsg_md.xp?AN=645152063
-- PhlIp


There's a COM available called Http2Asp and it can call ASP pages and return with the HTML produced. You could match this against an expected result.


See also: ActiveServerPages


CategoryTesting


EditText of this page (last edited December 13, 2005) or FindPage with title or text search