As a work around you can store your href using storeXPath into a property.
Then with a bit of scripting encode the URL, see:

http://webtest-community.canoo.com/wiki/space/EncodeProperty

Then use invoke with the encoded URL.

Cheers, Paul.

Saul Simhon wrote:
Of course, sorry about forgetting to attach it in the first place. One thing that I would like to clarify, I actually tried it with the url un-escaped (I had a version encoded and decoded and mistook the wrong url in my original email)! I know its bad style, but in any case, browsers typically encode hlinks before the request is made (the link works when manually clicking on it in the browser)!


om.canoo.webtest.engine.StepExecutionException: Unexpected exception caught: java.lang.IllegalArgumentException: Invalid uri '/p:Kenmore Progressive 35922 Upright:2002230711;_ylc=X3oDMTEwNWdsM3JpBF9TAzc4NDcwMDMwOQRzZWMDY3JzaXRlBHNsawNsaW5r': escaped absolute path not valid, Step: ClickLink at /Users/saul/CU/dev-pwi/projects/webtest/crp/crp-verify.xml:477: with (href="Upright:2002230711", saveResponse="true", description="Follow the link to shop online", savePrefix="online-page", stepType="clickLink")
at com.canoo.webtest.steps.Step.handleUnexpectedException(Step.java:518)
at com.canoo.webtest.steps.AbstractBrowserAction.handleUnexpectedException(AbstractBrowserAction.java:122) at com.canoo.webtest.steps.request.TargetHelper.protectedGoto(TargetHelper.java:82) at com.canoo.webtest.steps.request.AbstractTargetAction.gotoTarget(AbstractTargetAction.java:97) at com.canoo.webtest.steps.request.AbstractTargetAction.doExecute(AbstractTargetAction.java:74)
at com.canoo.webtest.steps.Step.execute(Step.java:166)
at com.canoo.webtest.engine.Engine.executeSteps(Engine.java:30)
at com.canoo.webtest.ant.WebtestTask.execute(WebtestTask.java:74)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:301)
at org.apache.tools.ant.Target.performTasks(Target.java:328)
at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:383)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:301)
at org.apache.tools.ant.Target.performTasks(Target.java:328)
at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
at org.apache.tools.ant.Main.runBuild(Main.java:632)
at org.apache.tools.ant.Main.startAnt(Main.java:183)
at org.apache.tools.ant.Main.start(Main.java:147)
at org.apache.tools.ant.Main.main(Main.java:230)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:13)


<td valign="top" style="padding-top:25px">
<!-- td cell with buttons  -->
<a href="http://shopping.yahoo.com/p:Kenmore Progressive 35922 Upright:2002230711;_ylc=X3oDMTEwNWdsM3JpBF9TAzc4NDcwMDMwOQRzZWMDY3JzaXRlBHNsawNsaW5r?cb=1"><img src="/crp/application-resources/images/shop-online/popshop_button1.gif" width="161" height="40" alt="" border="0"></a><br><br>






On 23-Feb-06, at 3:05 AM, Marc Guillemot wrote:

Saul Simhon <[EMAIL PROTECTED]> writes:

Hi,
I am getting the following error when using the clickLink ant task on a web page:

Unexpected exception caught: java.lang.IllegalArgumentException: Invalid uri
'/p:Kenmore Progressive 35922 Upright:2002230711;_ylc=X3oDMTEwNWdsM3JpBF9TAzc4N
DcwMDMwOQRzZWMDY3JzaXRlBHNsawNsaW5r': escaped absolute path not valid

The actual URL in the html page is: /p:Kenmore%20Progressive%2035922%20Uprigh
t:2002230711;_ylc=X3oDMTEwNWdsM3JpBF9TAzc4NDcwMDMwOQRzZWMDY3JzaXRlBHNsawNsaW5
r?cb=1

For some reason, the href is being decoded and it looks like it is not
re-encoded when creating the URL object? Is there a way around this problem?

Hi Saul,

can you provide the stack trace of the exception as well as the html code
snippet involved in the error?
What is the encoding of the page?

Marc.

_______________________________________________
WebTest mailing list
[email protected] <mailto:[email protected]>
http://lists.canoo.com/mailman/listinfo/webtest


_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to