Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically Testing Classic ASP

I've been researching automated testing of classic ASP websites to help bring my company into the late 1990's. We run an application made up of ~14K classic ASP pages, with ASP .NET slowly gaining more of a share.

We've introduced unit tests for our core .NET functionality, but I was curious: how do others handle unit testing and automated testing for classic ASP? Especially with respect to testing both back end code, and front end pages.

Thanks, tmcg

like image 759
tmcg Avatar asked Dec 02 '11 20:12

tmcg


People also ask

How do I run classic ASP on IIS?

In Control Panel, click Programs and Features, and then click Turn Windows features on or off. Expand Internet Information Services, expand World Wide Web Services, expand Application Development Features, and then select ASP. The ISAPI Extensions feature will be selected if it has not already been installed. Click OK.

What is meant by classic asp?

Classic ASP is a server-side scripting environment that you can use to create and run dynamic web applications. With ASP, you can combine HTML pages, script commands, and COM components to create interactive web pages that are easy to develop and modify.

What is ASP NET testing?

Introduction to testing for ASP.Net This test is the functionality of an application. The testing is conducted to ensure that the application behaves as expected. In ASP.Net, the first task is to create a test project in Visual Studio. The test project will contain the necessary code to test the application.


4 Answers

maybe this helps? asp ajaxed Creating unit tests for classic asp

generally you need to create some infrastructure (all just vbscript code) and then you are able to do the following:

<!--#include virtual="/ajaxed/class_TestFixture/testFixture.asp"-->
<%
set tf = new TestFixture
tf.allEnvs = true
tf.run()

sub test_1()
    tf.assert 1 = 1, "1 is not equal 1"
end sub

sub test_2()
    tf.assert 1 = 2, "1 is not equal 1"
end sub
%>

test_1 would be successful and test_2 would fail obviously.

you can find the source code of that asp ajaxed framework here

there you can have a look at the testFixture.asp class

like image 129
ulluoink Avatar answered Oct 06 '22 12:10

ulluoink


We use Selenium successfully with an array of positive and negative tests to make sure that the pages properly function, that the back-end handles issues with bad user input and that appropriate success and error messages are displayed to the user.

This doesn't provide unit testing but it does a good job of making sure our old Classic ASP code continues running smoothly.

like image 24
Dave Brockman Avatar answered Oct 06 '22 11:10

Dave Brockman


I have used Rational Functional Tester on an ASP Classic app. It was more for the end users to get a warm and fuzzy feeling when a new feature was released. But, it does work.

http://www-01.ibm.com/software/awdtools/tester/functional/

like image 24
user1319487 Avatar answered Oct 06 '22 11:10

user1319487


We ended up going with Selenium to drive the testing, but it has not made the jump from proof of concept to implementation at large. Thanks, everyone.

like image 40
tmcg Avatar answered Oct 06 '22 11:10

tmcg