[Webtest] stupid webtest question #426. Can I store a constan t for later us e?

Bill Milbratz webtest@lists.canoo.com
Tue, 30 Sep 2003 09:32:32 -0500


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------=_NextPartTM-000-a6d57a04-f0d2-4122-b786-e2d754f8a4ec
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C3875F.AEF1A220"

------_=_NextPart_001_01C3875F.AEF1A220
Content-Type: text/plain;
	charset="iso-8859-1"

This still doesn't work. 
 
 
   xpath="concat('MyConstant','')"
 
 [testSpec] Start Step: Set Required Info Code" (6/31)
 [testSpec] org.dom4j.XPathException: Exception occurred evaluting XPath:
The result of the
XPath expression is not a Node. It was: MyConstant of type:
java.lang.String. You might want
 to use a different method such as selectObject() to evaluate this XPath
expression
 [testSpec]     at
org.dom4j.xpath.DefaultXPath.selectSingleNode(DefaultXPath.java:163)
 [testSpec]     at
org.dom4j.tree.AbstractNode.selectSingleNode(AbstractNode.java:188)
 
I'm using an older build. (278) Could this be the a factor?
 
Can someone incorporate Marc Guillemot's code in the task?
 
thanks,
 
bill m
 
 
 
 
 

-----Original Message-----
From: Dierk Koenig [mailto:dierk.koenig@canoo.com]
Sent: Tuesday, September 30, 2003 2:16 AM
To: webtest@lists.canoo.com
Subject: RE: [Webtest] stupid webtest question #426. Can I store a constant
for later us e?


sorry, small mixup with ' and ". it needs to be 
 
xpath="concat('MyConstant','')"
 
 
 cheers
Mittie
 -----Original Message-----
From: webtest-admin@lists.canoo.com [mailto:webtest-admin@lists.canoo.com]On
Behalf Of Bill Milbratz
Sent: Dienstag, 30. September 2003 1:55
To: 'webtest@lists.canoo.com'
Subject: RE: [Webtest] stupid webtest question #426. Can I store a constant
for later us e?




>In our current project we have the very same issue.
>You need to find an xpath expression that evaluates to your 'constant', eg.
xpath="concat(''MYCONSTANT,'')"
 
This sounded good, but such a concat  (and all combinations I tried) gave me
the following errors. Any suggestions?
e.g. these xpath's:
xpath="concat(''MYCONSTANT','')"

xpath="concat(//title,'MYCONSTANT')"
 
Yielded these such errors:


 [testSpec] org.dom4j.XPathException: Exception occurred evaluting XPath:
The result of the
XPath expression is not a Node. It was: a of type: java.lang.String. You
might want to use a
 different method such as selectObject() to evaluate this XPath expression
 [testSpec]     at
org.dom4j.xpath.DefaultXPath.selectSingleNode(DefaultXPath.java:163)
 [testSpec]     at
org.dom4j.tree.AbstractNode.selectSingleNode(AbstractNode.java:188)
 [testSpec]     at
com.canoo.webtest.steps.StoreXPath.getXPath(StoreXPath.java:83)
 [testSpec]     at
com.canoo.webtest.steps.StoreXPath.doExecute(StoreXPath.java:58)
 [testSpec]     at com.canoo.webtest.steps.Step.execute(Step.java:56)
 [testSpec]     at
com.canoo.webtest.engine.Engine.executeSteps(Engine.java:32)
 [testSpec]     at
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask
 
thanks,
 
bill m

 


------_=_NextPart_001_01C3875F.AEF1A220
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>stupid webtest question #426. Can I store a constant for later use?</TITLE>

<META content="MSHTML 6.00.2800.1226" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face="Arial Unicode MS">
<DIV><SPAN class=698091307-30092003><FONT face=Courier><FONT color=#0000ff><FONT 
size=2><SPAN class=376402814-30092003>This still doesn't work. 
</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=698091307-30092003><FONT face=Courier><FONT color=#0000ff><FONT 
size=2><SPAN 
class=376402814-30092003></SPAN></FONT></FONT></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=698091307-30092003><FONT face=Courier><FONT color=#0000ff><FONT 
size=2><SPAN 
class=376402814-30092003></SPAN></FONT></FONT></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=698091307-30092003><FONT><FONT color=#0000ff><FONT size=2><SPAN 
class=376402814-30092003></SPAN></FONT></FONT></FONT></SPAN><SPAN 
class=698091307-30092003><FONT><FONT><SPAN class=376402814-30092003></SPAN><FONT 
face=Courier><FONT color=#0000ff><FONT size=2><SPAN 
class=376402814-30092003>&nbsp;&nbsp; 
</SPAN>xpath="concat('MyConstant','')"</FONT></FONT></FONT></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=698091307-30092003><FONT face=Courier color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=698091307-30092003><FONT color=#0000ff size=2>&nbsp;[testSpec] 
Start Step: Set Required Info Code" (6/31)<BR>&nbsp;[testSpec] 
org.dom4j.XPathException: Exception occurred evaluting XPath: The result of 
the<BR>XPath expression is not a Node. It was: MyConstant of type: 
java.lang.String. You might want<BR>&nbsp;to use a different method such as 
selectObject() to evaluate this XPath 
expression<BR>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at 
org.dom4j.xpath.DefaultXPath.selectSingleNode(DefaultXPath.java:163)<BR>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; 
at 
org.dom4j.tree.AbstractNode.selectSingleNode(AbstractNode.java:188)</FONT></SPAN></DIV>
<DIV><SPAN class=698091307-30092003><FONT color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=698091307-30092003>
<DIV><SPAN class=698091307-30092003><FONT face=Courier><FONT color=#0000ff><FONT 
size=2><SPAN class=376402814-30092003>I'm using an older&nbsp;build. (278) Could 
this be the a factor?</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=698091307-30092003><FONT face=Courier><FONT color=#0000ff><FONT 
size=2><SPAN 
class=376402814-30092003></SPAN></FONT></FONT></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=698091307-30092003><FONT face=Courier><FONT color=#0000ff><FONT 
size=2><SPAN class=376402814-30092003>Can someone incorporate Marc Guillemot's 
code in the task?</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=698091307-30092003><FONT face=Courier><FONT color=#0000ff><FONT 
size=2><SPAN 
class=376402814-30092003></SPAN></FONT></FONT></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=698091307-30092003><FONT face=Courier><FONT color=#0000ff><FONT 
size=2><SPAN 
class=376402814-30092003>thanks,</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=698091307-30092003><FONT face=Courier><FONT color=#0000ff><FONT 
size=2><SPAN 
class=376402814-30092003></SPAN></FONT></FONT></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=698091307-30092003><FONT face=Courier><FONT color=#0000ff><FONT 
size=2><SPAN class=376402814-30092003>bill 
m</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=698091307-30092003><FONT face=Courier><FONT color=#0000ff><FONT 
size=2><SPAN 
class=376402814-30092003></SPAN></FONT></FONT></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=698091307-30092003><FONT face=Courier><FONT color=#0000ff><FONT 
size=2><SPAN 
class=376402814-30092003></SPAN></FONT></FONT></FONT></SPAN>&nbsp;</DIV></SPAN></DIV>
<DIV><SPAN class=698091307-30092003><FONT color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=698091307-30092003><FONT color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=698091307-30092003><FONT color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV></FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> Dierk Koenig 
  [mailto:dierk.koenig@canoo.com]<BR><B>Sent:</B> Tuesday, September 30, 2003 
  2:16 AM<BR><B>To:</B> webtest@lists.canoo.com<BR><B>Subject:</B> RE: [Webtest] 
  stupid webtest question #426. Can I store a constant for later us 
  e?<BR><BR></FONT></DIV>
  <DIV><SPAN class=698091307-30092003><FONT face=Arial color=#0000ff 
  size=2>sorry, small mixup with ' and ". it needs to be </FONT></SPAN></DIV>
  <DIV><SPAN class=698091307-30092003><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=698091307-30092003><FONT face=Courier color=#0000ff 
  size=2>xpath="concat('MyConstant','')"</FONT></SPAN></DIV>
  <DIV><SPAN class=698091307-30092003><FONT face=Courier color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=698091307-30092003><FONT face=Courier color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><FONT face=Tahoma><FONT size=2><SPAN class=698091307-30092003><FONT 
  face=Arial color=#0000ff>&nbsp;cheers</FONT></SPAN></FONT></FONT></DIV>
  <DIV><FONT face=Tahoma><FONT size=2><SPAN class=698091307-30092003><FONT 
  face=Arial color=#0000ff>Mittie</FONT></SPAN></FONT></FONT></DIV>
  <DIV><FONT face=Tahoma><FONT size=2><SPAN 
  class=698091307-30092003>&nbsp;</SPAN>-----Original 
  Message-----<BR><B>From:</B> webtest-admin@lists.canoo.com 
  [mailto:webtest-admin@lists.canoo.com]<B>On Behalf Of </B>Bill 
  Milbratz<BR><B>Sent:</B> Dienstag, 30. September 2003 1:55<BR><B>To:</B> 
  'webtest@lists.canoo.com'<BR><B>Subject:</B> RE: [Webtest] stupid webtest 
  question #426. Can I store a constant for later us 
  e?<BR><BR></DIV></FONT></FONT>
  <BLOCKQUOTE dir=ltr 
  style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
    <DIV><FONT face="Arial Unicode MS">
    <DIV><SPAN class=383080908-26092003><FONT face=Arial><FONT 
    color=#0000ff><FONT size=2><SPAN class=897375023-29092003>&gt;</SPAN>In our 
    current project we have the very same 
    issue.</FONT></FONT></FONT></SPAN></DIV>
    <DIV><SPAN class=383080908-26092003><FONT face=Arial><FONT 
    color=#0000ff><FONT size=2><SPAN class=897375023-29092003>&gt;</SPAN>You 
    need to find an xpath expression that evaluates to your 'constant', eg. 
    xpath="concat(''MYCONSTANT,'')"</FONT></FONT></FONT></SPAN></DIV></FONT></DIV>
    <DIV><FONT face="Arial Unicode MS" color=#0000ff size=2></FONT>&nbsp;</DIV>
    <DIV><SPAN class=897375023-29092003><FONT face="Arial Unicode MS" 
    color=#0000ff size=2>This sounded good, but such a concat&nbsp; (and all 
    combinations I tried) gave me the following errors. Any 
    suggestions?</FONT></SPAN></DIV>
    <DIV><SPAN class=897375023-29092003><FONT face="Arial Unicode MS" 
    color=#0000ff size=2>e.g. these xpath's:</FONT></SPAN></DIV>
    <DIV><SPAN class=897375023-29092003><FONT face=Arial color=#0000ff 
    size=2>xpath="concat(''MYCONSTANT','')"</FONT></SPAN></DIV>
    <DIV><SPAN class=897375023-29092003>
    <DIV><SPAN class=897375023-29092003><FONT face=Arial color=#0000ff 
    size=2>xpath="concat(//title,'MYCONSTANT')"</FONT></SPAN></DIV></SPAN></DIV>
    <DIV><SPAN class=897375023-29092003><FONT face="Arial Unicode MS" 
    color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV><SPAN class=897375023-29092003></SPAN><FONT 
    face="Arial Unicode MS"><FONT color=#0000ff><FONT size=2>Y<SPAN 
    class=897375023-29092003>ielded these such 
    errors:</SPAN></FONT></FONT></FONT></DIV><FONT face="Arial Unicode MS"><FONT 
    color=#0000ff><FONT size=2><SPAN 
    class=897375023-29092003></SPAN></FONT></FONT></FONT><FONT 
    face="Arial Unicode MS" color=#0000ff size=2></FONT><FONT 
    face="Arial Unicode MS" color=#0000ff size=2></FONT><FONT 
    face="Arial Unicode MS" color=#0000ff size=2></FONT>
    <DIV><BR><FONT face="Arial Unicode MS" color=#0000ff size=2>&nbsp;[testSpec] 
    org.dom4j.XPathException: Exception occurred evaluting XPath: The result of 
    the<BR>XPath expression is not a Node. It was: a of type: java.lang.String. 
    You might want to use a<BR>&nbsp;different method such as selectObject() to 
    evaluate this XPath expression<BR>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; 
    at 
    org.dom4j.xpath.DefaultXPath.selectSingleNode(DefaultXPath.java:163)<BR>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; 
    at 
    org.dom4j.tree.AbstractNode.selectSingleNode(AbstractNode.java:188)<BR>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; 
    at 
    com.canoo.webtest.steps.StoreXPath.getXPath(StoreXPath.java:83)<BR>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; 
    at 
    com.canoo.webtest.steps.StoreXPath.doExecute(StoreXPath.java:58)<BR>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; 
    at 
    com.canoo.webtest.steps.Step.execute(Step.java:56)<BR>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; 
    at 
    com.canoo.webtest.engine.Engine.executeSteps(Engine.java:32)<BR>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; 
    at 
    com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask</FONT></DIV>
    <DIV><FONT face="Arial Unicode MS" color=#0000ff size=2></FONT>&nbsp;</DIV>
    <DIV><SPAN class=897375023-29092003><FONT face="Arial Unicode MS" 
    color=#0000ff size=2>thanks,</FONT></SPAN></DIV>
    <DIV><SPAN class=897375023-29092003><FONT face="Arial Unicode MS" 
    color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV><SPAN class=897375023-29092003><FONT face="Arial Unicode MS" 
    color=#0000ff size=2>bill m</FONT></SPAN></DIV>
    <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
      <DIV class=OutlookMessageHeader dir=ltr align=left><FONT 
      face="Arial Unicode MS" color=#0000ff 
  size=2></FONT>&nbsp;</DIV></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------_=_NextPart_001_01C3875F.AEF1A220--

------=_NextPartTM-000-a6d57a04-f0d2-4122-b786-e2d754f8a4ec--