I'm evaluating WebTest for an application over HTTPS with Basic
Authentication. The first steps worked really fine but now I reached the
point where I need some help. I have the following xml file:
<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "../dtd/Project.dtd">
<project default="test">
<property name="webtest.connectioninitializer"
value="com.canoo.webtest.security.SunJsseBaseConnectionInitializer"/>
<property name="webtest.truststore.file"
value="c:\Programme\Java\jdk1.6.0_14\jre\lib\security\cacerts" />
<property name="webtest.truststore.passphrase" value="changeit" />
<target name="test">
<webtest name="Testname">
<config
host="192.0.0.169"
port="443"
protocol="https"
basepath="path"
/>
<invoke
url="page01.html"
username="xxx"
password="xxx"
description="Load page"
/>
<verifyTitle
text="Title"
description="Check title"
/>
<clickButton
name="button_1"
username="xxx"
password="xxx"
description="Switch to input page"
/>
<setSelectField
name="select_1"
text="Value1"
username="xxx"
password="xxx"
description="Set value"
/>
<clickButton
name="button_2"
description="Store"
/>
</webtest>
</target>
</project>
After running the test I get the following result:
Message
Unexpected exception caught: java.lang.RuntimeException
Location
<Filename> (line: 33) => clickButton
Exception
com.canoo.webtest.engine.StepExecutionException
On the command line I get the following result:
"java.exe" -Xms64M -Xmx256M -cp
"C:\WebTest\bin\..\lib\ant-launcher-1.7.0.jar" -
Dant.library.dir="C:\WebTest\bin\..\lib"
"-Dlog4j.configuration=file:/C:\WebTest
\bin\..\lib/log4j.properties" org.apache.tools.ant.launch.Launcher
-nouserlib -l
ib "C:\WebTest\bin\..\lib\build;C:\WebTest\bin\..\lib\build\clover.jar"
-buildfi
le runSuite1.xml
Unable to locate tools.jar. Expected to find it in
C:\Programme\Java\jre6\lib\to
ols.jar
Buildfile: runSuite1.xml
wt.init:
wt.init.headless:
wt.defineTimestamps:
wt.defineTasks.init:
~wt.defineTasks.defineClasspath:
wt.defineTasks:
wt.webtestMonitor:
[echo] C:\WebTest/tools/WebTestMonitor.groovy
wt.defineMacros:
[echo] No macro to define
wt.generateDtd:
[groovyScript] Scanning for entities...
[groovyScript] 0 entities found
[groovyScript] Already uptodate: \dtd\Project.dtd
wt.generateDefinitions:
[groovyScript] Definitions dir not found: \definitions. Ignoring.
wt.createReportsFolder:
wt.deleteReports:
wt.parallel.init:
wt.before.testInWork:
wt.testInWork:
[echo] Execution suite1.xml in dir \test:
[webtest] INFO (com.canoo.webtest.ant.WebtestTask) - Starting webtest
"Testname" (\tests\test.xml:11: )
[webtest] INFO (com.canoo.webtest.ant.WebtestTask) - Canoo Webtest:
R_1766.
[config] INFO (com.canoo.webtest.engine.Configuration) - Using
haltonerror f
rom project property wt.config.haltonerror: false
[config] INFO (com.canoo.webtest.engine.Configuration) - Using
haltonfailure
from project property wt.config.haltonfailure: false
[config] INFO (com.canoo.webtest.engine.Configuration) - Using
resultpath fr
om project property wt.config.resultpath: \results
[config] INFO (com.canoo.webtest.engine.Configuration) - Using
saveresponse
from project property wt.config.saveresponse: true
[config] INFO (com.canoo.webtest.engine.Configuration) - Using
summary from
project property wt.config.summary: true
[config] INFO (com.canoo.webtest.engine.Configuration) - Creating
result dir
ectory: \results\001_SetzenDerLiefera
[config] INFO (com.canoo.webtest.engine.Configuration) - Surfing
with defaul
t browser Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
[steps] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
steps "Impli
cit <steps> task" (1/5)
[invoke] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
invoke "Load page" (1/5)
[invoke] INFO (com.canoo.webtest.steps.request.TargetHelper) -
getting respo
nse for url: https://192.0.0.169/path/page01.html
[invoke] INFO (com.canoo.webtest.steps.request.TargetHelper) -
Setting passw
ord for username: installateur
[invoke] INFO (com.canoo.webtest.steps.request.TargetHelper) - Using
custom
initializer: com.canoo.webtest.security.SunJsseBaseConnectionInitializer
[invoke] INFO
(com.canoo.webtest.security.SunJsseBaseConnectionInitializer)
- Installing HostnameVerifier
[invoke] INFO
(org.apache.commons.httpclient.auth.AuthChallengeProcessor) -
basic authentication scheme selected
[invoke] INFO (com.canoo.webtest.engine.WebClientContext) - Content
of windo
w changed to https://192.0.0.169/path/page01.html (text/html)
[invoke] INFO (com.canoo.webtest.engine.WebClientContext) - Content
loaded i
n newly opened window, its content will become current response
[invoke] INFO (com.canoo.webtest.engine.WebClientContext) - Current
form set
to none
[invoke] INFO (com.canoo.webtest.engine.WebClientContext) - Current
response
now: https://192.0.0.169/path/page01.html
[verifyTitle] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
verifyTitl
e "Check Title" (2/5)
[clickButton] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
clickButto
n "Switch to input page" (3/5)
[clickButton] INFO (com.canoo.webtest.steps.request.ClickButton) - ->
findTarge
t(by input): name=button_1 value=
[clickButton] INFO
(org.apache.commons.httpclient.auth.AuthChallengeProcessor)
- basic authentication scheme selected
INFO (com.canoo.webtest.engine.WebClientContext) - Responses restored
INFO (com.canoo.webtest.ant.WebtestTask) - Finished executing webtest
"Testname" (\tests\test.xml:11: )
INFO (com.canoo.webtest.reporting.XmlReporter) - Writing report to
\results\001_SetzenDerLiefera\WebTestReport.xml
INFO (com.canoo.webtest.ant.WebtestTask) - Test report successfully
created.
wt.groovyTests:
wt.parallel.waitForCompletion:
wt.htmlReports.init:
wt.htmlReports:
[mkdir] Created dir: \results\resou
rces
[copy] Copying 20 files to \result
s\resources
[xslt] Transforming into \results
[xslt] Processing \results\001_SetzenDerLiefera\WebTestReport.xml
to \results\001_SetzenDerLiefera\WebTestReport.html
[xslt] Loading stylesheet C:\WebTest\resources\WebTestReport.xsl
[xslt] Transforming into \results
[xslt] Processing \results\001_Set
zenDerLiefera\WebTestReport.xml to \res
ults\001_SetzenDerLiefera\WebTestSummary.xml
[xslt] Loading stylesheet
C:\WebTest\resources\WebTestReportSummaryExtracto
r.xsl
[groovyScript] Reading \results\001_Set
zenDerLiefera\WebTestSummary.xml
[groovyScript] Writing \results\WebTest
Overview.xml
[xslt] Processing \results\WebTest
Overview.xml to \results\index.html
[xslt] Loading stylesheet
C:\WebTest\resources\WebTestReportOverview.xsl
wt.openResultFile.init:
wt.openResultFile:
[echo] Opening result file \result
s\index.html with cmd
wt.junitLikeReports:
[xslt] Processing \results\WebTest
Overview.xml to \results\WebTestOvervie
w.junit.xml
[xslt] Loading stylesheet
C:\WebTest\resources\WebTestOverview2JUnit.xsl
wt.countWebtestResults:
BUILD FAILED
C:\WebTest\webtest.xml:432: 1 of 1 webtests have failed (0 successful)!
Total time: 1 minute 16 seconds
What have I to do to get this test to work? Any ideas?
Thanks in advance!
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest