[Webtest] bug: evaluating string results in storexpath
Christopher Painter-Wakefield
webtest@lists.canoo.com
Tue, 18 Mar 2003 12:44:02 -0500
Thanks for implementing storexpath, whoever did it - I've been needing it
badly!
However, it has a bug. When the xpath expression returns a String instead
of a node, the code throws an exception:
Exception occurred evaluting XPath: The result of the XPath expression is
not a Node. It was: 53752 of type: java.lang.String. You might want to use
a different method such as selectObject() to evaluate this XPath expression
An example of an xpath expression returning a String is:
"substring-after(html/a/@href, '=')", which I am trying to use to just
store just the query parameter out of a url.
It looks like the problem is on the line (in StoreXPath.java):
Node node = document.selectSingleNode( fXPath );
Since you are returning a String anyway, why not just use "document.valueOf
( fXPath );"?
Can someone apply a fix?
Thanks!
-Christopher