[Webtest] (newbie) IOException on PHP files (build 365)
Peter Cruickshank
webtest@lists.canoo.com
Thu, 9 Oct 2003 18:41:47 +0100
Hi Marc
I installed build 378 and you're right, the error messages were more useful:
turns out the code was buffering page outoput using gz compression (using
ob_start('gz_handler') ) - I turned off the compression, and webtest now
runs.
New question: I also get a new warning message:
[testSpec] log4j:WARN No appenders could be found for logger
(com.meterware.httpunit.HttpWebResponse).
[testSpec] log4j:WARN Please initialize the log4j system properly.
- so how do I initialise log4j?
Thanks again!
Peter
On Thursday 09 Oct 2003 3:08 pm, Marc Guillemot wrote:
> 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.StepExecutionExcep
> >>ti 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>
>
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
--
Peter Cruickshank
t: +44 (0)7092 086 881
e: peter at cruickshank dot biz