[Webtest] clicklink question (newbie)

Dierk Koenig webtest@lists.canoo.com
Tue, 14 Oct 2003 09:53:54 +0200


This type of url is currently not supported.

As a workaround you need to use a direct "invoke" to go to your admin page.
The url of this page is either well-known to you, such that you can
put it in the invoke step, or it is somewhere in your current page
source such that you can extract it via "storexpath" or "storeregex".

hope that helps
Mittie

> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com]On Behalf Of Sean Crosson
> Sent: Montag, 13. Oktober 2003 22:35
> To: webtest@lists.canoo.com
> Subject: [Webtest] clicklink question (newbie)
>
>
> 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(Test
> Specificat
> ionTask.java:84)
> 	at
> com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificat
> ionTask.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(TestSpecificat
> ionTask.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.StepExecuti
> onExceptio
> 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(TestSpecificat
> ionTask.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(Test
> Specificat
> ionTask.java:84)
> 	at
> com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificat
> ionTask.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
>
>
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>
>