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

Dierk Koenig webtest@lists.canoo.com
Tue, 30 Sep 2003 09:16:23 +0200


This is a multi-part message in MIME format.

------=_NextPart_000_0004_01C38733.84A19650
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

stupid webtest question #426. Can I store a constant for later use?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_000_0004_01C38733.84A19650
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>stupid webtest question #426. Can I store a constant =
for later use?</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1226" name=3DGENERATOR></HEAD>
<BODY>
<DIV><SPAN class=3D698091307-30092003><FONT face=3DArial color=3D#0000ff =
size=3D2>sorry,=20
small mixup with ' and ". it needs to be </FONT></SPAN></DIV>
<DIV><SPAN class=3D698091307-30092003><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D698091307-30092003><FONT face=3DCourier =
color=3D#0000ff=20
size=3D2>xpath=3D"concat('MyConstant','')"</FONT></SPAN></DIV>
<DIV><SPAN class=3D698091307-30092003><FONT face=3DCourier =
color=3D#0000ff=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D698091307-30092003><FONT face=3DCourier =
color=3D#0000ff=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><FONT face=3DTahoma><FONT size=3D2><SPAN =
class=3D698091307-30092003><FONT=20
face=3DArial =
color=3D#0000ff>&nbsp;cheers</FONT></SPAN></FONT></FONT></DIV>
<DIV><FONT face=3DTahoma><FONT size=3D2><SPAN =
class=3D698091307-30092003><FONT=20
face=3DArial color=3D#0000ff>Mittie</FONT></SPAN></FONT></FONT></DIV>
<DIV><FONT face=3DTahoma><FONT size=3D2><SPAN=20
class=3D698091307-30092003>&nbsp;</SPAN>-----Original =
Message-----<BR><B>From:</B>=20
webtest-admin@lists.canoo.com =
[mailto:webtest-admin@lists.canoo.com]<B>On Behalf=20
Of </B>Bill Milbratz<BR><B>Sent:</B> Dienstag, 30. September 2003=20
1:55<BR><B>To:</B> 'webtest@lists.canoo.com'<BR><B>Subject:</B> RE: =
[Webtest]=20
stupid webtest question #426. Can I store a constant for later us=20
e?<BR><BR></DIV></FONT></FONT>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
solid; MARGIN-RIGHT: 0px">
  <DIV><FONT face=3D"Arial Unicode MS">
  <DIV><SPAN class=3D383080908-26092003><FONT face=3DArial><FONT =
color=3D#0000ff><FONT=20
  size=3D2><SPAN class=3D897375023-29092003>&gt;</SPAN>In our current =
project we=20
  have the very same issue.</FONT></FONT></FONT></SPAN></DIV>
  <DIV><SPAN class=3D383080908-26092003><FONT face=3DArial><FONT =
color=3D#0000ff><FONT=20
  size=3D2><SPAN class=3D897375023-29092003>&gt;</SPAN>You need to find =
an xpath=20
  expression that evaluates to your 'constant', eg.=20
  =
xpath=3D"concat(''MYCONSTANT,'')"</FONT></FONT></FONT></SPAN></DIV></FONT=
></DIV>
  <DIV><FONT face=3D"Arial Unicode MS" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
  <DIV><SPAN class=3D897375023-29092003><FONT face=3D"Arial Unicode MS"=20
  color=3D#0000ff size=3D2>This sounded good, but such a concat&nbsp; =
(and all=20
  combinations I tried) gave me the following errors. Any=20
  suggestions?</FONT></SPAN></DIV>
  <DIV><SPAN class=3D897375023-29092003><FONT face=3D"Arial Unicode MS"=20
  color=3D#0000ff size=3D2>e.g. these xpath's:</FONT></SPAN></DIV>
  <DIV><SPAN class=3D897375023-29092003><FONT face=3DArial =
color=3D#0000ff=20
  size=3D2>xpath=3D"concat(''MYCONSTANT','')"</FONT></SPAN></DIV>
  <DIV><SPAN class=3D897375023-29092003>
  <DIV><SPAN class=3D897375023-29092003><FONT face=3DArial =
color=3D#0000ff=20
  =
size=3D2>xpath=3D"concat(//title,'MYCONSTANT')"</FONT></SPAN></DIV></SPAN=
></DIV>
  <DIV><SPAN class=3D897375023-29092003><FONT face=3D"Arial Unicode MS"=20
  color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D897375023-29092003></SPAN><FONT face=3D"Arial =
Unicode MS"><FONT=20
  color=3D#0000ff><FONT size=3D2>Y<SPAN =
class=3D897375023-29092003>ielded these such=20
  errors:</SPAN></FONT></FONT></FONT></DIV><FONT face=3D"Arial Unicode =
MS"><FONT=20
  color=3D#0000ff><FONT size=3D2><SPAN=20
  class=3D897375023-29092003></SPAN></FONT></FONT></FONT><FONT=20
  face=3D"Arial Unicode MS" color=3D#0000ff size=3D2></FONT><FONT=20
  face=3D"Arial Unicode MS" color=3D#0000ff size=3D2></FONT><FONT=20
  face=3D"Arial Unicode MS" color=3D#0000ff size=3D2></FONT>
  <DIV><BR><FONT face=3D"Arial Unicode MS" color=3D#0000ff =
size=3D2>&nbsp;[testSpec]=20
  org.dom4j.XPathException: Exception occurred evaluting XPath: The =
result of=20
  the<BR>XPath expression is not a Node. It was: a of type: =
java.lang.String.=20
  You might want to use a<BR>&nbsp;different method such as =
selectObject() to=20
  evaluate this XPath =
expression<BR>&nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp; at=20
  =
org.dom4j.xpath.DefaultXPath.selectSingleNode(DefaultXPath.java:163)<BR>&=
nbsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp;=20
  at=20
  =
org.dom4j.tree.AbstractNode.selectSingleNode(AbstractNode.java:188)<BR>&n=
bsp;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp;=20
  at=20
  =
com.canoo.webtest.steps.StoreXPath.getXPath(StoreXPath.java:83)<BR>&nbsp;=
[testSpec]&nbsp;&nbsp;&nbsp;&nbsp;=20
  at=20
  =
com.canoo.webtest.steps.StoreXPath.doExecute(StoreXPath.java:58)<BR>&nbsp=
;[testSpec]&nbsp;&nbsp;&nbsp;&nbsp;=20
  at=20
  =
com.canoo.webtest.steps.Step.execute(Step.java:56)<BR>&nbsp;[testSpec]&nb=
sp;&nbsp;&nbsp;&nbsp;=20
  at=20
  =
com.canoo.webtest.engine.Engine.executeSteps(Engine.java:32)<BR>&nbsp;[te=
stSpec]&nbsp;&nbsp;&nbsp;&nbsp;=20
  at=20
  =
com.canoo.webtest.ant.TestSpecificationTask.execute(TestSpecificationTask=
</FONT></DIV>
  <DIV><FONT face=3D"Arial Unicode MS" color=3D#0000ff =
size=3D2></FONT>&nbsp;</DIV>
  <DIV><SPAN class=3D897375023-29092003><FONT face=3D"Arial Unicode MS"=20
  color=3D#0000ff size=3D2>thanks,</FONT></SPAN></DIV>
  <DIV><SPAN class=3D897375023-29092003><FONT face=3D"Arial Unicode MS"=20
  color=3D#0000ff size=3D2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D897375023-29092003><FONT face=3D"Arial Unicode MS"=20
  color=3D#0000ff size=3D2>bill m</FONT></SPAN></DIV>
  <BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
    <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT=20
    face=3D"Arial Unicode MS" color=3D#0000ff=20
size=3D2></FONT>&nbsp;</DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0004_01C38733.84A19650--