[Webtest] 'Results.html not found' - still
Troy McGuire
webtest@lists.canoo.com
Tue, 08 Aug 2006 21:57:44 -0700
Here is my config
<config
host="secure.customerdb.com"
port="443"
protocol="https"
basepath="admin"
summary="true"
resultpath="${webtest.resultpath}"
resultfile="${webtest.resultfile}"
saveresponse="true"
showhtmlparseroutput="true">
<header name="followRedirects" value="true" />
</config>
Does anyone know what the Unix/Linux equivalent to filemon is?
I typed "ant -debug -buildfile mybuild_04.xml" (is that what you meant
about running ant with -debug?), but, in the middle of the output I got:
********** START of Ant Debug Output **********
Finding class com.canoo.webtest.reporting.PlainTextReporter
Loaded from /usr/local/sbin/canoo_webtest/lib/webtest.jar
com/canoo/webtest/reporting/PlainTextReporter.class
Class com.canoo.webtest.reporting.PlainTextReporter loaded from ant
loader (parentFirst)
[ant] Exiting
/usr/local/www/customer.com/qa/canoo_webtest/sa_loginpage_04.xml.
[antcall] Exiting
/usr/local/www/customer.com/qa/canoo_webtest/mybuild_04.xml.
BUILD FAILED
/usr/local/www/customer.com/qa/canoo_webtest/mybuild_04.xml:21: The
following error occurred while executing this line:
/usr/local/www/customer.com/qa/canoo_webtest/mybuild_04.xml:61: The
following error occurred while executing this line:
/usr/local/www/customer.com/qa/canoo_webtest/sa_loginpage_04.xml:11:
Canoo Webtest: development.
Test failed.
Exception raised: com.canoo.webtest.engine.StepExecutionException:
Unexpected exception caught: java.lang.AbstractMethodError, Step:
InvokePage at
/usr/local/www/customer.com/qa/canoo_webtest/sa_loginpage_04.xml:29:
with (stepType="invoke", description="Get Login Page", url="index.php",
method="GET")com.canoo.webtest.engine.StepExecutionException: Unexpected
exception caught: java.lang.AbstractMethodError, Step: InvokePage at
/usr/local/www/customer.com/qa/canoo_webtest/sa_loginpage_04.xml:29:
with (stepType="invoke", description="Get Login Page", url="index.php",
method="GET")
at com.canoo.webtest.steps.Step.handleUnexpectedException(Step.java:607)
at
com.canoo.webtest.steps.AbstractBrowserAction.handleUnexpectedException(AbstractBrowserAction.java:117)
at
com.canoo.webtest.steps.request.TargetHelper.protectedGoto(TargetHelper.java:109)
at
com.canoo.webtest.steps.request.AbstractTargetAction.gotoTarget(AbstractTargetAction.java:111)
at
com.canoo.webtest.steps.request.AbstractTargetAction.doExecute(AbstractTargetAction.java:79)
at com.canoo.webtest.steps.Step.execute(Step.java:136)
at org.apache.tools.ant.Task.perform(ant-1.6.5.jar.so)
at com.canoo.webtest.engine.Engine.executeSteps(Engine.java:39)
at com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:105)
at org.apache.tools.ant.UnknownElement.execute(ant-1.6.5.jar.so)
at org.apache.tools.ant.Task.perform(ant-1.6.5.jar.so)
at org.apache.tools.ant.Target.execute(ant-1.6.5.jar.so)
at org.apache.tools.ant.Target.performTasks(ant-1.6.5.jar.so)
at org.apache.tools.ant.Project.executeSortedTargets(ant-1.6.5.jar.so)
at
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(ant-1.6.5.jar.so)
at org.apache.tools.ant.Project.executeTargets(ant-1.6.5.jar.so)
at org.apache.tools.ant.taskdefs.Ant.execute(ant-1.6.5.jar.so)
at org.apache.tools.ant.UnknownElement.execute(ant-1.6.5.jar.so)
at org.apache.tools.ant.Task.perform(ant-1.6.5.jar.so)
at org.apache.tools.ant.Target.execute(ant-1.6.5.jar.so)
at org.apache.tools.ant.Target.performTasks(ant-1.6.5.jar.so)
at org.apache.tools.ant.Project.executeSortedTargets(ant-1.6.5.jar.so)
at
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(ant-1.6.5.jar.so)
at org.apache.tools.ant.Project.executeTargets(ant-1.6.5.jar.so)
at org.apache.tools.ant.taskdefs.Ant.execute(ant-1.6.5.jar.so)
at org.apache.tools.ant.taskdefs.CallTarget.execute(ant-1.6.5.jar.so)
at org.apache.tools.ant.UnknownElement.execute(ant-1.6.5.jar.so)
at org.apache.tools.ant.Task.perform(ant-1.6.5.jar.so)
at org.apache.tools.ant.Target.execute(ant-1.6.5.jar.so)
at org.apache.tools.ant.Target.performTasks(ant-1.6.5.jar.so)
at org.apache.tools.ant.Project.executeSortedTargets(ant-1.6.5.jar.so)
at org.apache.tools.ant.Project.executeTarget(ant-1.6.5.jar.so)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(ant-1.6.5.jar.so)
at org.apache.tools.ant.Project.executeTargets(ant-1.6.5.jar.so)
at org.apache.tools.ant.Main.runBuild(ant-1.6.5.jar.so)
at org.apache.tools.ant.Main.startAnt(ant-1.6.5.jar.so)
at org.apache.tools.ant.launch.Launcher.run(ant-launcher-1.6.5.jar.so)
at org.apache.tools.ant.launch.Launcher.main(ant-launcher-1.6.5.jar.so)
********** END of Ant Debug Output **********
Line 11 of sa_loginpage_04.xml is below:
09 <echo message="Start execution of '${test.file}' in dir
'${test.dir}'"/>
10 <!-- <ant antfile="${test.file}" dir="${test.dir}"/> -->
11 <webtest name="sa_loginpage">
12 &config;
13 <steps>
14 <invoke
15 description="Get Login Page"
Paul King wrote:
>
> I can't see anything wrong with what you have. I have a cut down
> version of your file on my system and it reliably produces the
> results file.
>
> It could possibly be an issue with your config.
> Where does that point the results file to?
> Is that file being produced? You could use something
> like filemon (sysinternals.com) to see whether
> the file is being written and where to.
>
> It could possibly be an 'ant' problem.
> What happens when you run ant with '-debug'?
>
> Paul.
>
> Troy McGuire wrote:
>> I made the changes suggested below and got the same output. Can
>> anyone tell me all (or nearly all) the reasons why this behavior
>> would occur? I had this working at one point, but it seems that the
>> "formatResults" target is precarious enough to break any time
>> something around it changes. Is there a more robust way of getting
>> WebTest to output HTML reports? Does it even seem like what I have
>> should work?
>>
>> Thank You,
>>
>> -Troy
>>
>>
>> Paul King wrote:
>>>
>>> Try removing '<include name="results.html"/>' from the fileset in
>>> the "copyResults" target and try setting
>>> 'basedir="${webtest.resultpath}"'
>>> in the "formatResults" target.
>>>
>>> Cheers, Paul.
>>>
>>> Troy McGuire wrote:
>>>> I'm still having difficulty getting my reporting to work for
>>>> webtest. I've started removing (and dividing) portions of my build
>>>> file to make it simple to debug, but still get the same error. Can
>>>> anyone tell me possible reasons why the results.html file isn't
>>>> being created? Below is my build file and the output from running
>>>> the build. Also, at the end of the output you can see where I 'ls'
>>>> the ${webtest.home}/resources
>>>> (/usr/local/sbin/canoo_webtest/resources/) directory and the
>>>> ${webtest.resultpath}
>>>> (/usr/local/www/customer.com/qa/canoo_webtest/webtest-results)
>>>> directory to display where the files are.
>>>>
>>>> Thank You,
>>>>
>>>> Troy
>>>> troy AT spawn OR die dt com
>>>>
>>>> ***** MY BUILD FILE *****
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <!DOCTYPE project SYSTEM
>>>> "/usr/local/sbin/canoo_webtest/selftests/config/WebTest.dtd">
>>>>
>>>> <project name="All Tests" basedir="." default="testSuite">
>>>> <property name="webtest.home"
>>>> location="/usr/local/sbin/canoo_webtest" />
>>>> <property name="resources.dir" value="${webtest.home}/resources"/>
>>>> <property name="test.dir"
>>>> location="/usr/local/www/customer.com/qa/canoo_webtest" />
>>>> <property name="test.file" value="mybuild_03.xml" />
>>>> <property name="webtest.resultpath"
>>>> value="${test.dir}/webtest-results"/>
>>>> <property name="webtest.resultfile" value="results.xml"/>
>>>> <property name="webtest.resultfile.html"
>>>> value="${webtest.resultpath}/results.html"/>
>>>> <import file="${webtest.home}/lib/taskdef.xml" />
>>>> <target name="init" description="Checks that needed properties
>>>> are defined">
>>>> <fail message="test.file should be set" unless="test.file" />
>>>> <fail message="test.dir should be set" unless="test.dir" />
>>>> </target>
>>>> <target name="testSuite" depends="init" description="Runs the
>>>> Test Suite">
>>>> <mkdir dir="${webtest.resultpath}" />
>>>> <antcall target="test.suite" />
>>>> <antcall target="formatResults" />
>>>> <antcall target="copyResults" />
>>>> <antcall target="makeIndexHTML" />
>>>> <!-- <antcall target="" /> -->
>>>> </target>
>>>>
>>>> <target name="formatResults" description="Formats the XML result
>>>> file using XSL">
>>>> <tstamp>
>>>> <format property="report.time" pattern="dd.MM.yyyy
>>>> HH:mm" locale="us" />
>>>> </tstamp>
>>>> <style
>>>> basedir="${resources.dir}"
>>>> destdir="${webtest.resultpath}"
>>>> includes="${webtest.resultpath}/${webtest.resultfile}"
>>>> force="true"
>>>> extension=".html"
>>>> style="${resources.dir}/WebTestReport.xsl">
>>>> <param name="reporttime" expression="${report.time}"/>
>>>> <param name="title" expression="${ant.project.name}"/>
>>>> </style>
>>>> </target>
>>>>
>>>> <target name="copyResults" description="Copies the resources
>>>> needed by the html page to the same dir. The report must be ok too
>>>> when opened from filesystem (without webserver)">
>>>> <copy todir="${webtest.resultpath}">
>>>> <fileset dir="${resources.dir}">
>>>> <include name="report.css"/>
>>>> <include name="showHide.js"/>
>>>> <include name="images/*.*"/>
>>>> <include name="results.html"/>
>>>> </fileset>
>>>> </copy>
>>>> </target>
>>>> <target name="makeIndexHTML" description="Copies the
>>>> results.xml or results.html to index.html or something like that" >
>>>> <copy tofile="${webtest.resultpath}/index.html"
>>>> file="${webtest.resultpath}/results.html"/>
>>>> <echo message="Webtest result overview available in
>>>> ${webtest.resultfile.html}"/>
>>>> </target>
>>>>
>>>> <target name="test.suite">
>>>> <ant antfile="sa_loginpage_02.xml"/>
>>>> <ant antfile="sa_login_02.xml"/>
>>>> </target>
>>>> </project>
>>>> ***** END OF BUILD FILE *****
>>>> ***** OUTPUT *****
>>>> [troy@localhost canoo_webtest]$ webtest mybuild_03.xml
>>>> Will use java
>>>> Buildfile: mybuild_03.xml
>>>> Trying to override old definition of task sleep
>>>>
>>>> init:
>>>>
>>>> testSuite:
>>>>
>>>> test.suite:
>>>>
>>>> loginPageTest:
>>>> [echo] Start execution of 'mybuild_03.xml' in dir
>>>> '/usr/local/www/customer.com/qa/canoo_webtest'
>>>> [webtest] INFO (com.canoo.webtest.ant.WebtestTask) - Canoo
>>>> Webtest: R_1217.
>>>> [config] INFO (com.canoo.webtest.engine.Configuration) - Surfing
>>>> with browser Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)
>>>> [config] INFO (com.canoo.webtest.engine.Configuration) -
>>>> Configuring 1 HTTP header field(s)
>>>> [config] INFO (com.canoo.webtest.engine.Configuration) -
>>>> Configured header "followRedirects": true
>>>> [invoke] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
>>>> invoke "Get Login Page" (1/2)
>>>> [invoke] INFO
>>>> (com.canoo.webtest.steps.request.AbstractTargetAction) - ->
>>>> gotoTarget by URL: index.php
>>>> [invoke] INFO (com.canoo.webtest.steps.request.TargetHelper) -
>>>> getting response for url:
>>>> https://secure.customerdb.com/admin/index.php
>>>> [invoke] INFO (org.apache.commons.httpclient.HttpMethodDirector)
>>>> - Redirect requested but followRedirects is disabled
>>>> [invoke] INFO (org.apache.commons.httpclient.HttpMethodDirector)
>>>> - Redirect requested but followRedirects is disabled
>>>> [invoke] INFO (org.apache.commons.httpclient.HttpMethodDirector)
>>>> - Redirect requested but followRedirects is disabled
>>>> [invoke] INFO (com.canoo.webtest.engine.Context) - Content of
>>>> window changed to https://secure.customerdb.com/admin/index.php
>>>> [invoke] INFO (com.canoo.webtest.engine.Context) - Content
>>>> loaded in newly opened window, its content will become current
>>>> response
>>>> [invoke] INFO (com.canoo.webtest.engine.Context) - Current form
>>>> set to none
>>>> [invoke] INFO (com.canoo.webtest.engine.Context) - Current
>>>> response now: https://secure.customerdb.com/admin/index.php
>>>> [verifyTitle] INFO (com.canoo.webtest.steps.Step) - >>>> Start
>>>> Step: verifyTitle "Verify Login Page Title" (2/2)
>>>> INFO (com.canoo.webtest.ant.WebtestTask) - Test report successfully
>>>> created.
>>>>
>>>> loginTest:
>>>> [echo] Start execution of 'mybuild_03.xml' in dir
>>>> '/usr/local/www/customer.com/qa/canoo_webtest'
>>>> [webtest] INFO (com.canoo.webtest.ant.WebtestTask) - Canoo
>>>> Webtest: R_1217.
>>>> [config] INFO (com.canoo.webtest.engine.Configuration) - Surfing
>>>> with browser Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)
>>>> [config] INFO (com.canoo.webtest.engine.Configuration) -
>>>> Configuring 1 HTTP header field(s)
>>>> [config] INFO (com.canoo.webtest.engine.Configuration) -
>>>> Configured header "followRedirects": true
>>>> [invoke] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
>>>> invoke "Login" (1/7)
>>>> [invoke] INFO
>>>> (com.canoo.webtest.steps.request.AbstractTargetAction) - ->
>>>> gotoTarget by URL: index.php
>>>> [invoke] INFO (com.canoo.webtest.steps.request.TargetHelper) -
>>>> getting response for url:
>>>> https://secure.customerdb.com/admin/index.php
>>>> [invoke] INFO (org.apache.commons.httpclient.HttpMethodDirector)
>>>> - Redirect requested but followRedirects is disabled
>>>> [invoke] INFO (org.apache.commons.httpclient.HttpMethodDirector)
>>>> - Redirect requested but followRedirects is disabled
>>>> [invoke] INFO (org.apache.commons.httpclient.HttpMethodDirector)
>>>> - Redirect requested but followRedirects is disabled
>>>> [invoke] INFO (com.canoo.webtest.engine.Context) - Content of
>>>> window changed to https://secure.customerdb.com/admin/index.php
>>>> [invoke] INFO (com.canoo.webtest.engine.Context) - Content
>>>> loaded in newly opened window, its content will become current
>>>> response
>>>> [invoke] INFO (com.canoo.webtest.engine.Context) - Current form
>>>> set to none
>>>> [invoke] INFO (com.canoo.webtest.engine.Context) - Current
>>>> response now: https://secure.customerdb.com/admin/index.php
>>>> [verifyTitle] INFO (com.canoo.webtest.steps.Step) - >>>> Start
>>>> Step: verifyTitle "Verify Login Page Title" (2/7)
>>>> [selectForm] INFO (com.canoo.webtest.steps.Step) - >>>> Start
>>>> Step: selectForm "Selects the Login Form" (3/7)
>>>> [selectForm] INFO (com.canoo.webtest.engine.Context) - Current
>>>> form set to (action=/admin/index.php)
>>>> [setInputField] INFO (com.canoo.webtest.steps.Step) - >>>> Start
>>>> Step: setInputField "Selects and sets the Username Field" (4/7)
>>>> [setInputField] INFO
>>>> (com.canoo.webtest.steps.form.AbstractSetFieldStep) - Found 1
>>>> suitable fields, considering only the first one
>>>> [setInputField] INFO (com.canoo.webtest.steps.Step) - >>>> Start
>>>> Step: setInputField "Selects and sets the Password Field" (5/7)
>>>> [setInputField] INFO
>>>> (com.canoo.webtest.steps.form.AbstractSetFieldStep) - Found 1
>>>> suitable fields, considering only the first one
>>>> [clickButton] INFO (com.canoo.webtest.steps.Step) - >>>> Start
>>>> Step: clickButton "Clicks the Login button" (6/7)
>>>> [clickButton] INFO
>>>> (com.canoo.webtest.steps.request.AbstractTargetAction) - ->
>>>> gotoTarget by clickButton with name: submitLogin
>>>> [clickButton] INFO (com.canoo.webtest.steps.request.ClickButton) -
>>>> -> findTarget(by input): name=submitLogin value=
>>>> [clickButton] INFO
>>>> (org.apache.commons.httpclient.HttpMethodDirector) - Redirect
>>>> requested but followRedirects is disabled
>>>> [clickButton] INFO (com.canoo.webtest.engine.Context) - Content of
>>>> window changed to
>>>> https://secure.customerdb.com/admin/index.php?submitLogin_x=0&submitLogin_y=0&
>>>>
>>>> [clickButton] INFO (com.canoo.webtest.engine.Context) - Content of
>>>> current window changed, it will become current response
>>>> [clickButton] INFO (com.canoo.webtest.engine.Context) - Current
>>>> form set to none
>>>> [clickButton] INFO (com.canoo.webtest.engine.Context) - Current
>>>> response now:
>>>> https://secure.customerdb.com/admin/index.php?submitLogin_x=0&submitLogin_y=0&
>>>>
>>>> [verifyText] INFO (com.canoo.webtest.steps.Step) - >>>> Start
>>>> Step: verifyText "Verifies unique text after login" (7/7)
>>>> INFO (com.canoo.webtest.ant.WebtestTask) - Test report successfully
>>>> created.
>>>>
>>>> formatResults:
>>>> [style] Transforming into
>>>> /usr/local/www/customer.com/qa/canoo_webtest/webtest-results
>>>>
>>>> copyResults:
>>>>
>>>> makeIndexHTML:
>>>>
>>>> BUILD FAILED
>>>> /usr/local/www/customer.com/qa/canoo_webtest/mybuild_03.xml:24: The
>>>> following error occurred while executing this line:
>>>> /usr/local/www/customer.com/qa/canoo_webtest/mybuild_03.xml:56:
>>>> Warning: Could not find file
>>>> /usr/local/www/customer.com/qa/canoo_webtest/webtest-results/results.html
>>>> to copy.
>>>>
>>>> Total time: 23 seconds
>>>> [troy@localhost canoo_webtest]$ cd
>>>> /usr/local/sbin/canoo_webtest/resources/
>>>> [troy@localhost resources]$ ls
>>>> images responseBrowserCommands.html
>>>> responseBrowser.js showHide.js WebTestReport.xsl
>>>> report.css responseBrowser.html
>>>> responseBrowserPreviews.html sorttable.js webtestsRunner.xml
>>>> [troy@localhost resources]$ cd
>>>> /usr/local/www/customer.com/qa/canoo_webtest/webtest-results
>>>> [troy@localhost webtest-results]$ ls
>>>> images report.css results.xml showHide.js
>>>> [troy@localhost webtest-results]$ ***** END OF OUTPUT *****
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>
> .
>