I'm in the process of migrating to a new computer. Today I downloaded
WebTest 2.1 (build 1393), followed the installation instructions on the
website, but got a "BUILD FAILED". I then attempted using version
2.0.1217 since that is the version that I have on the computer that I am
migrating from, but got the same results. I made sure my JDK and Ant
versions are good, the path is being exported in my .bashrc, and I made
'webtest.sh' executable. I did verfiy that [WEBTEST_HOME]/doc/samples
contains 'testfile.html' and that the file does have the title that
installTest.xml is looking for. When I run WebTest on the
installTest.xml file I get the following output:
Will use java
Buildfile: installTest.xml
Trying to override old definition of task sleep
checkANT:
mayPrintANTError:
checkWebTest:
[echo] webtest.home is /usr/local/sbin/canoo_webtest/doc/samples/../..
[testSpec] INFO (com.canoo.webtest.ant.WebtestTask) - Canoo Webtest:
development.
[config] WARN (com.canoo.webtest.engine.Configuration) - Result dir
'webtest-results' not created (may not be needed), may cause problems if
individual steps set save attribute
[config] INFO (com.canoo.webtest.engine.Configuration) - Surfing
with browser Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98)
[invoke] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
invoke "get local file" (1/2)
[invoke] INFO (com.canoo.webtest.steps.request.AbstractTargetAction)
- -> gotoTarget by URL:
/usr/local/sbin/canoo_webtest/doc/samples/testfile.html
[invoke] INFO (com.canoo.webtest.steps.request.TargetHelper) -
getting response for url:
file:/usr/local/sbin/canoo_webtest/doc/samples/testfile.html
[invoke] INFO (com.canoo.webtest.engine.Context) - Content of window
changed to file:/usr/local/sbin/canoo_webtest/doc/samples/testfile.html
[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: file:/usr/local/sbin/canoo_webtest/doc/samples/testfile.html
[verifyTitle] INFO (com.canoo.webtest.steps.Step) - >>>> Start Step:
verifyTitle "check the title is parsed correctly" (2/2)
[verifyTitle] INFO (com.canoo.webtest.steps.Step) - Running with: Canoo
Webtest: development.
[verifyTitle] INFO (com.canoo.webtest.steps.Step) - Exception thrown
from this class: java.lang.ClassCastException
[verifyTitle] INFO (com.canoo.webtest.steps.Step) - Message was:
com.gargoylesoftware.htmlunit.UnexpectedPage cannot be cast to
com.gargoylesoftware.htmlunit.html.HtmlPage
[verifyTitle] ERROR (com.canoo.webtest.steps.Step) - Cannot handle
unexpected exception in step VerifyTitle at
/usr/local/sbin/canoo_webtest/doc/samples/installTest.xml:25: with
(stepType="verifyTitle", descriptio
[verifyTitle] n="check the title is parsed correctly", text="Test File
Title")
[verifyTitle] java.lang.ClassCastException:
com.gargoylesoftware.htmlunit.UnexpectedPage cannot be cast to com.gar
[verifyTitle] goylesoftware.htmlunit.html.HtmlPage
[verifyTitle] at
com.canoo.webtest.steps.verify.VerifyTitle.doExecute(VerifyTitle.java:23)
[verifyTitle] at com.canoo.webtest.steps.Step.execute(Step.java:136)
[verifyTitle] at org.apache.tools.an
[verifyTitle] t.Task.perform(Task.java:365)
[verifyTitle] at
com.canoo.webtest.engine.Engine.executeSteps(Engine.java:39)
[verifyTitle] at
com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:105)
[verifyTitle] at org.apache.tools.ant.Unknow
[verifyTitle] nElement.execute(UnknownElement.java:280)
[verifyTitle] at org.apache.tools.ant.Task.perform(Task.java:365)
[verifyTitle] at org.apache.tools.ant.Target.execute(Target.java:341)
[verifyTitle] at org.apache.tools.ant.Target.performTas
[verifyTitle] ks(Target.java:370)
[verifyTitle] at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1217)
[verifyTitle] at
org.apache.tools.ant.Project.executeTarget(Project.java:1186)
[verifyTitle] at org.apache.tools.ant.helper.Def
[verifyTitle] aultExecutor.executeTargets(DefaultExecutor.java:41)
[verifyTitle] at
org.apache.tools.ant.Project.executeTargets(Project.java:1070)
[verifyTitle] at org.apache.tools.ant.Main.runBuild(Main.java:672)
[verifyTitle] at org.apache.tools
[verifyTitle] .ant.Main.startAnt(Main.java:188)
[verifyTitle] at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:247)
[verifyTitle] at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:68)
BUILD FAILED
/usr/local/sbin/canoo_webtest/doc/samples/installTest.xml:10: Canoo
Webtest: development.
Test failed.
Exception raised: com.canoo.webtest.engine.StepExecutionException:
Unexpected exception caught: java.lang.ClassCastException:
com.gargoylesoftware.htmlunit.UnexpectedPage cannot be cast to
com.gargoylesoftware.htmlunit.html.HtmlPage, Step: VerifyTitle at
/usr/local/sbin/canoo_webtest/doc/samples/installTest.xml:25: with
(stepType="verifyTitle", description="check the title is parsed
correctly", text="Test File
Title")com.canoo.webtest.engine.StepExecutionException: Unexpected
exception caught: java.lang.ClassCastException:
com.gargoylesoftware.htmlunit.UnexpectedPage cannot be cast to
com.gargoylesoftware.htmlunit.html.HtmlPage, Step: VerifyTitle at
/usr/local/sbin/canoo_webtest/doc/samples/installTest.xml:25: with
(stepType="verifyTitle", description="check the title is parsed
correctly", text="Test File Title")
at com.canoo.webtest.steps.Step.handleUnexpectedException(Step.java:607)
at com.canoo.webtest.steps.Step.execute(Step.java:139)
at org.apache.tools.ant.Task.perform(Task.java:365)
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(UnknownElement.java:280)
at org.apache.tools.ant.Task.perform(Task.java:365)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:370)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1217)
at org.apache.tools.ant.Project.executeTarget(Project.java:1186)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1070)
at org.apache.tools.ant.Main.runBuild(Main.java:672)
at org.apache.tools.ant.Main.startAnt(Main.java:188)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:247)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:68)
Caused by: java.lang.ClassCastException:
com.gargoylesoftware.htmlunit.UnexpectedPage cannot be cast to
com.gargoylesoftware.htmlunit.html.HtmlPage
at
com.canoo.webtest.steps.verify.VerifyTitle.doExecute(VerifyTitle.java:23)
at com.canoo.webtest.steps.Step.execute(Step.java:136)
...15 more
Total time: 4 seconds
Can someone help me understand why this isn't working? Is there some
obvious, non-documented, step that I didn't take?
Thanks,
Troy
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest