[Webtest] clicklink question (newbie)

Sean Crosson webtest@lists.canoo.com
Mon, 13 Oct 2003 16:34:54 -0400


Hi,

I'm trying to use clicklink to test a link that uses javascript to submit,
as in:

	<clicklink stepid="Link to Profile/User Admin"
                 label="Profile/User Admin"
                 href="javascript:showAdminPage()"/>

The label field contains the exact text that is in the alt field in the html
file.  When I try to build here's the output I get:

BUILD FAILED
file:C:/Canoo/build/doc/samples/profileuseradmin.xml:9: Test failed.
Test step clicklink named "Profile/User Admin Page" failed with message
"Step "Profile/User Admin Page" (8/9): Link not found in page: <Profile/User
Admin>"
	at
com.canoo.webtest.ant.TestSpecificationTask.stopBuildIfNeeded(TestSpecificat
ionTask.java:84)
	at
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask.ja
va:76)
	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: 12 seconds


I've tried removing the label text and using only the link, as in:

	<clicklink stepid="Link to Profile/User Admin"
                 label=""
                 href="javascript:showAdminPage()"/>

Then I get this error:

main:
 [testSpec] java.lang.NullPointerException
 [testSpec] 	at
com.canoo.webtest.steps.request.Target.getResponse(Target.java:262)
 [testSpec] 	at
com.canoo.webtest.steps.request.Target$2.call(Target.java:235)
 [testSpec] 	at
com.canoo.webtest.steps.request.Target.protectedGoto(Target.java:167)
 [testSpec] 	at
com.canoo.webtest.steps.request.Target.gotoTarget(Target.java:230)
 [testSpec] 	at
com.canoo.webtest.steps.request.ClickLink.doExecute(ClickLink.java:42)
 [testSpec] 	at com.canoo.webtest.steps.Step.execute(Step.java:69)
 [testSpec] 	at com.canoo.webtest.engine.Engine.executeSteps(Engine.java:32)
 [testSpec] 	at
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask.ja
va:72)
 [testSpec] 	at org.apache.tools.ant.Task.perform(Task.java:341)
 [testSpec] 	at org.apache.tools.ant.Target.execute(Target.java:309)
 [testSpec] 	at org.apache.tools.ant.Target.performTasks(Target.java:336)
 [testSpec] 	at
org.apache.tools.ant.Project.executeTarget(Project.java:1339)
 [testSpec] 	at
org.apache.tools.ant.Project.executeTargets(Project.java:1255)
 [testSpec] 	at org.apache.tools.ant.Main.runBuild(Main.java:609)
 [testSpec] 	at org.apache.tools.ant.Main.start(Main.java:196)
 [testSpec] 	at org.apache.tools.ant.Main.main(Main.java:235)

BUILD FAILED
file:C:/Canoo/build/doc/samples/profileuseradmin.xml:9: Test failed.
Exception raised: com.canoo.webtest.engine.StepExecutionException:
Unexpected exception caught:
java.lang.NullPointerExceptioncom.canoo.webtest.engine.StepExecutionExceptio
n: Unexpected exception caught: java.lang.NullPointerException
	at com.canoo.webtest.steps.Step.handleUnexpectedException(Step.java:308)
	at com.canoo.webtest.steps.request.Target.protectedGoto(Target.java:184)
	at com.canoo.webtest.steps.request.Target.gotoTarget(Target.java:230)
	at com.canoo.webtest.steps.request.ClickLink.doExecute(ClickLink.java:42)
	at com.canoo.webtest.steps.Step.execute(Step.java:69)
	at com.canoo.webtest.engine.Engine.executeSteps(Engine.java:32)
	at
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask.ja
va:72)
	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)

	at
com.canoo.webtest.ant.TestSpecificationTask.stopBuildIfNeeded(TestSpecificat
ionTask.java:84)
	at
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask.ja
va:76)
	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: 12 seconds

Thanks for any help you can provide.

Sean