6 messages in com.canoo.lists.webtest[Webtest] (newbie) IOException on PHP...
FromSent OnAttachments
Peter Cruickshank07 Oct 2003 04:32 
Peter Cruickshank08 Oct 2003 11:59 
Marc Guillemot09 Oct 2003 07:07 
Peter Cruickshank09 Oct 2003 10:41 
Marc Guillemot09 Oct 2003 23:53 
Peter Cruickshank14 Oct 2003 03:41 
Subject:[Webtest] (newbie) IOException on PHP files (build 365)
From:Peter Cruickshank (li@cruickshank.biz)
Date:10/07/2003 04:32:02 AM
List:com.canoo.lists.webtest

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>