[Webtest] (newbie) IOException on PHP files (build 365)

Peter Cruickshank webtest@lists.canoo.com
Tue, 7 Oct 2003 12:32:24 +0100


Hi again

I'm still getting the hang of webtest - I wrote a small script to test a page 
generated by a PHP application (4images). It fails with an IOException if I 
try examining a page generated by php (index.php), but if I save the 
generated page as HTML, then the validation works fine.

I've also noticed that IOException is thrown on the HTML too if httpd is not 
running - not sure if that's relevant though.

Has anyone else come across (and solved?) this. I include a log and a copy of 
the webtest xml file, in case they're any use. 

Thanks (in advance) again!

Peter

**** LOG
[peter@main 4images]$ ant -buildfile installTest2.xml
Buildfile: installTest2.xml

all:

BUILD FAILED
file:/var/www/webtest/4images/installTest2.xml:5: Test failed.
Exception raised: com.canoo.webtest.engine.StepExecutionException: Unexpected 
exception caught: 
java.lang.NullPointerExceptioncom.canoo.webtest.engine.StepExecutionException: 
Unexpected exception caught: java.lang.NullPointerException
        at 
com.canoo.webtest.steps.Step.handleUnexpectedException(Step.java:307)
        at com.canoo.webtest.steps.Step.execute(Step.java:73)
        at com.canoo.webtest.engine.Engine.executeSteps(Engine.java:32)
        at 
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask.java:72)
        at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:193)
        at org.apache.tools.ant.Task.perform(Task.java:341)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:336)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
        at org.apache.tools.ant.Main.runBuild(Main.java:609)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)


Total time: 6 seconds

**** WEBTEST FILE (in /var/www/webtest/4images, testing //localhost/4images/ 
held at /var/www/html/4images/)

<project name="4Images" basedir="/var/www/html/4images" default="all">
	<property name="base.dir" value="4images"/>
	<property name="webtest.home" value="/usr/local/webtest"/>
	<target name="all">
		<testSpec name="check calling and parsing a local file">
			<config host="localhost"
			         protocol="http"
					 basepath="${base.dir}"
					 resultpath="/var/www/webtest/4images/results"
					 saveresponse="true"
					 showhtmlparseroutput="true" /> <!-- no output is being shown -->
			<steps>
				<invoke stepid="Get home page" url="test_index.html"/> <!-- this works -->
<!--				<invoke stepid="Get home page" url="index.php"/> this throws 
IOException -->
 				<verifytitle stepid="Check page title" text="BWP Photo archive"/>
			</steps>
		</testSpec>
	</target>
	<taskdef file="${webtest.home}/webtestTaskdefs.properties">
		<classpath>
			<fileset dir="${webtest.home}" includes="**/lib/*.jar"/>
		</classpath>

	</taskdef>
</project>



-- 
Peter Cruickshank
e: peter at cruickshank dot biz