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

Marc Guillemot webtest@lists.canoo.com
Thu, 09 Oct 2003 16:08:10 +0200


Hi Peter,

which build do you use?
Can you try with the last build. This would show more information on the 
java.lang.NullPointerException root exception to try to locate the problem.

Marc.

Peter Cruickshank wrote:
> Anyone?
> 
> Is there another route I should be investigating?
> 
> Thanks again
> 
> On Tuesday 07 Oct 2003 12:32 pm, Peter Cruickshank wrote:
> 
>>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.StepExecutionExcepti
>>on: 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.j
>>ava: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>
> 
>