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

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


This is a multi-part message in MIME format.

------=_NextPart_000_0004_01C38771.8BD74120
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

stupid webtest question #426. Can I store a constant for later use?This is
due to the old build.

A contribution like Marc's was incorporated with build 364
http://webtest.canoo.com/buildservlet/BuildServlet?log200308111907:
"make storexpath work with non-node expressions: contribution of Christopher
Painter-Wakefield"
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 16:33
  To: 'webtest@lists.canoo.com'
  Subject: RE: [Webtest] stupid webtest question #426. Can I store a
constant for later us e?


  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_000_0004_01C38771.8BD74120
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=3D874163614-30092003><FONT face=3DArial color=3D#0000ff =
size=3D2>This=20
is due to the old build.</FONT></SPAN></DIV>
<DIV><SPAN class=3D874163614-30092003><FONT face=3DArial color=3D#0000ff =

size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=3D874163614-30092003><FONT face=3DArial color=3D#0000ff =
size=3D2>A=20
contribution like Marc's was incorporated with build =
364</FONT></SPAN></DIV>
<DIV><SPAN class=3D874163614-30092003><FONT face=3DArial color=3D#0000ff =
size=3D2><A=20
href=3D"http://webtest.canoo.com/buildservlet/BuildServlet?log20030811190=
7">http://webtest.canoo.com/buildservlet/BuildServlet?log200308111907</A>=
:</FONT></SPAN></DIV>
<DIV><SPAN class=3D874163614-30092003><FONT face=3DArial color=3D#0000ff =
size=3D2>"<FONT=20
face=3D"Times New Roman" color=3D#000000 size=3D3>make storexpath work =
with non-node=20
expressions: contribution of Christopher=20
Painter-Wakefield</FONT>"</FONT></SPAN><SPAN=20
class=3D874163614-30092003></SPAN></DIV>
<DIV><SPAN class=3D874163614-30092003><FONT face=3DArial color=3D#0000ff =

size=3D2>cheers</FONT></SPAN></DIV>
<DIV><SPAN class=3D874163614-30092003><FONT face=3DArial color=3D#0000ff =

size=3D2>Mittie</FONT>&nbsp;</SPAN></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px =
solid; MARGIN-RIGHT: 0px">
  <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
  size=3D2>-----Original Message-----<BR><B>From:</B>=20
  webtest-admin@lists.canoo.com =
[mailto:webtest-admin@lists.canoo.com]<B>On=20
  Behalf Of </B>Bill Milbratz<BR><B>Sent:</B> Dienstag, 30. September =
2003=20
  16:33<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></FONT></DIV>
  <DIV><FONT face=3D"Arial Unicode MS">
  <DIV><SPAN class=3D698091307-30092003><FONT face=3DCourier><FONT=20
  color=3D#0000ff><FONT size=3D2><SPAN class=3D376402814-30092003>This =
still doesn't=20
  work. </SPAN></FONT></FONT></FONT></SPAN></DIV>
  <DIV><SPAN class=3D698091307-30092003><FONT face=3DCourier><FONT=20
  color=3D#0000ff><FONT size=3D2><SPAN=20
  =
class=3D376402814-30092003></SPAN></FONT></FONT></FONT></SPAN>&nbsp;</DIV=
>
  <DIV><SPAN class=3D698091307-30092003><FONT face=3DCourier><FONT=20
  color=3D#0000ff><FONT size=3D2><SPAN=20
  =
class=3D376402814-30092003></SPAN></FONT></FONT></FONT></SPAN>&nbsp;</DIV=
>
  <DIV><SPAN class=3D698091307-30092003><FONT size=3D+0><FONT =
color=3D#0000ff><FONT=20
  size=3D2><SPAN =
class=3D376402814-30092003></SPAN></FONT></FONT></FONT></SPAN><SPAN=20
  class=3D698091307-30092003><FONT size=3D+0><FONT size=3D+0><SPAN=20
  class=3D376402814-30092003></SPAN><FONT face=3DCourier><FONT =
color=3D#0000ff><FONT=20
  size=3D2><SPAN class=3D376402814-30092003>&nbsp;&nbsp;=20
  =
</SPAN>xpath=3D"concat('MyConstant','')"</FONT></FONT></FONT></FONT></FON=
T></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 color=3D#0000ff=20
  size=3D2>&nbsp;[testSpec] Start Step: Set Required Info Code"=20
  (6/31)<BR>&nbsp;[testSpec] org.dom4j.XPathException: Exception =
occurred=20
  evaluting XPath: The result of the<BR>XPath expression is not a Node. =
It was:=20
  MyConstant of type: java.lang.String. You might want<BR>&nbsp;to use a =

  different method such as selectObject() to evaluate this XPath=20
  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)</FONT=
></SPAN></DIV>
  <DIV><SPAN class=3D698091307-30092003><FONT color=3D#0000ff=20
  size=3D2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D698091307-30092003>
  <DIV><SPAN class=3D698091307-30092003><FONT face=3DCourier><FONT=20
  color=3D#0000ff><FONT size=3D2><SPAN class=3D376402814-30092003>I'm =
using an=20
  older&nbsp;build. (278) Could this be the a=20
  factor?</SPAN></FONT></FONT></FONT></SPAN></DIV>
  <DIV><SPAN class=3D698091307-30092003><FONT face=3DCourier><FONT=20
  color=3D#0000ff><FONT size=3D2><SPAN=20
  =
class=3D376402814-30092003></SPAN></FONT></FONT></FONT></SPAN>&nbsp;</DIV=
>
  <DIV><SPAN class=3D698091307-30092003><FONT face=3DCourier><FONT=20
  color=3D#0000ff><FONT size=3D2><SPAN class=3D376402814-30092003>Can =
someone=20
  incorporate Marc Guillemot's code in the=20
  task?</SPAN></FONT></FONT></FONT></SPAN></DIV>
  <DIV><SPAN class=3D698091307-30092003><FONT face=3DCourier><FONT=20
  color=3D#0000ff><FONT size=3D2><SPAN=20
  =
class=3D376402814-30092003></SPAN></FONT></FONT></FONT></SPAN>&nbsp;</DIV=
>
  <DIV><SPAN class=3D698091307-30092003><FONT face=3DCourier><FONT=20
  color=3D#0000ff><FONT size=3D2><SPAN=20
  =
class=3D376402814-30092003>thanks,</SPAN></FONT></FONT></FONT></SPAN></DI=
V>
  <DIV><SPAN class=3D698091307-30092003><FONT face=3DCourier><FONT=20
  color=3D#0000ff><FONT size=3D2><SPAN=20
  =
class=3D376402814-30092003></SPAN></FONT></FONT></FONT></SPAN>&nbsp;</DIV=
>
  <DIV><SPAN class=3D698091307-30092003><FONT face=3DCourier><FONT=20
  color=3D#0000ff><FONT size=3D2><SPAN class=3D376402814-30092003>bill=20
  m</SPAN></FONT></FONT></FONT></SPAN></DIV>
  <DIV><SPAN class=3D698091307-30092003><FONT face=3DCourier><FONT=20
  color=3D#0000ff><FONT size=3D2><SPAN=20
  =
class=3D376402814-30092003></SPAN></FONT></FONT></FONT></SPAN>&nbsp;</DIV=
>
  <DIV><SPAN class=3D698091307-30092003><FONT face=3DCourier><FONT=20
  color=3D#0000ff><FONT size=3D2><SPAN=20
  =
class=3D376402814-30092003></SPAN></FONT></FONT></FONT></SPAN>&nbsp;</DIV=
></SPAN></DIV>
  <DIV><SPAN class=3D698091307-30092003><FONT color=3D#0000ff=20
  size=3D2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D698091307-30092003><FONT color=3D#0000ff=20
  size=3D2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=3D698091307-30092003><FONT color=3D#0000ff=20
  size=3D2></FONT></SPAN>&nbsp;</DIV></FONT></DIV>
  <BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
    <DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT =
face=3DTahoma=20
    size=3D2>-----Original Message-----<BR><B>From:</B> Dierk Koenig=20
    [mailto:dierk.koenig@canoo.com]<BR><B>Sent:</B> Tuesday, September =
30, 2003=20
    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=20
    e?<BR><BR></FONT></DIV>
    <DIV><SPAN class=3D698091307-30092003><FONT face=3DArial =
color=3D#0000ff=20
    size=3D2>sorry, small mixup with ' and ". it needs to be =
</FONT></SPAN></DIV>
    <DIV><SPAN class=3D698091307-30092003><FONT face=3DArial =
color=3D#0000ff=20
    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=20
    Message-----<BR><B>From:</B> webtest-admin@lists.canoo.com=20
    [mailto:webtest-admin@lists.canoo.com]<B>On Behalf Of </B>Bill=20
    Milbratz<BR><B>Sent:</B> Dienstag, 30. September 2003 =
1:55<BR><B>To:</B>=20
    'webtest@lists.canoo.com'<BR><B>Subject:</B> RE: [Webtest] stupid =
webtest=20
    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=20
      color=3D#0000ff><FONT size=3D2><SPAN =
class=3D897375023-29092003>&gt;</SPAN>In=20
      our current project we have the very same=20
      issue.</FONT></FONT></FONT></SPAN></DIV>
      <DIV><SPAN class=3D383080908-26092003><FONT face=3DArial><FONT=20
      color=3D#0000ff><FONT size=3D2><SPAN =
class=3D897375023-29092003>&gt;</SPAN>You=20
      need to find an xpath 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=20
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=20
      face=3D"Arial Unicode MS"><FONT color=3D#0000ff><FONT =
size=3D2>Y<SPAN=20
      class=3D897375023-29092003>ielded these such=20
      errors:</SPAN></FONT></FONT></FONT></DIV><FONT=20
      face=3D"Arial Unicode MS"><FONT 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=20
      size=3D2>&nbsp;[testSpec] org.dom4j.XPathException: Exception =
occurred=20
      evaluting XPath: The result of the<BR>XPath expression is not a =
Node. It=20
      was: a of type: java.lang.String. You might want to use=20
      a<BR>&nbsp;different method such as selectObject() to evaluate =
this XPath=20
      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=20
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></BLOCKQUOTE></BLOC=
KQUOTE></BODY></HTML>

------=_NextPart_000_0004_01C38771.8BD74120--