[Webtest] [webtest][JIRA] Created: (WT-52) failing to parse xpath expression with parent node

jiyun kim (JIRA) webtest@lists.canoo.com
Wed, 22 Jun 2005 19:26:16 +0200 (CEST)


failing to parse xpath expression with parent node
--------------------------------------------------

         Key: WT-52
         URL: http://webtest-community.canoo.com/jira/browse/WT-52
     Project: WebTest
        Type: Bug
 Environment: webtest as of 6/21/2005
htmlunit-20050621.jar
jaxen-1.1-beta-6.jar
    Reporter: jiyun kim


unexpected exception caught when using xpath with reference to parent node

test script
<steps>
<invoke url="test0.html"/>
<storeXPath xpath="count(//a/img[contains(@src,&quot;gif&quot;)])" property="link.cnt"/>
<storeXPath			   xpath="(//a/img[contains(@src,&quot;gif&quot;)])[#{link.cnt}]/../@href" property="link.href"/>		
</steps>

sample html
<html>
<head>
<body>
<p>Testing for webtest xpath</p>
<p><a><img src=images/select.gif></a></p>
<p><a><img src=images/select.gif></a></p>
</body>
</html>

exception 

BUILD FAILED: 

Exception raised: com.canoo.webtest.engine.StepExecutionException: Unexpected exception caught: org.jaxen.XPathSyntaxException: Node-set expected, Step: StoreXPath at /Users/jiyunkim/eclipse/workspace/canoo/sample/googletest.xml:41:  with (Property="link.href", -> computed value="null", description="get href of last gif image link", XPath="(//a/img[contains(@src,"gif")])[2]/../@href", stepType="storeXPath")com.canoo.webtest.engine.StepExecutionException: Unexpected exception caught: org.jaxen.XPathSyntaxException: Node-set expected, Step: StoreXPath at /Users/jiyunkim/eclipse/workspace/canoo/sample/googletest.xml:41:  with (Property="link.href", -> computed value="null", description="get href of last gif image link", XPath="(//a/img[contains(@src,"gif")])[2]/../@href", stepType="storeXPath")


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://webtest-community.canoo.com/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira