[Webtest] Problems with verifySelectField

Soula, William Soula, William" <wsoula@pointserve.com
Wed, 6 Aug 2008 14:45:30 -0500


--_000_93B3B6122B906D44BC7E8B8CEFB0DBBB1845056EA0SGPEXCHANGEpo_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I see a few problems here.  First, your verifySelectField should use the xp=
ath attribute instead of the name attribute, if you want to find it by xpat=
h like your example.  Second, I think your storeXPath's xpath is wrong for =
storing the value of the selected option.  Someone else emailed in to try a=
nd figure out how to store a value from a dropdownlist: http://www.nabble.c=
om/How-to-store-value-from-dropdownlist-to16834696.html#a16834696
Or you can just model after this one: //td/select[@id=3D'Line_Of_Sight_Spee=
d__INPUT_BOX']/option[@selected=3D'selected']"

See if this info helps :)

Will

________________________________
From: webtest-admin@lists.canoo.com [mailto:webtest-admin@lists.canoo.com] =
On Behalf Of Steve Chikwaya
Sent: Wednesday, August 06, 2008 1:38 PM
To: webtest@lists.canoo.com
Subject: [Webtest] Problems with verifySelectField

Hi everyone,

I am having a problem with verifySelectField in that it does not pick out t=
he currently selected item in a drop down box.  The drop down is a list of =
34 languages and based on the session, can be set to any one of those 34.  =
When i try to use verifySelectField to check which select option is current=
ly selected, i get the "No suitable form found having field named" error.  =
storeXPath picks up the the correct language, but verifySelectField does no=
t seem to recognize the xpath.

here is my code:

<storeXPath
            description=3D"store english language property"
            xpath=3D"/html/body/div[@id=3D'header']/div[@id=3D'LangLogout']=
/form[@id=3D'langSelectlist']/select/option/."
            property=3D"defaultLang" />
        <ifStep description=3D"change language to English">
            <condition>
                <verifySelectField description=3D"Check for language drop d=
own"
                          name=3D"/html/body/div[@id=3D'header']/div[@id=3D=
'LangLogout']/form[@id=3D'langSelectlist']//select/option/." value=3D"Engli=
sh (USA)" />
            </condition>
            <then>
                <setSelectField description=3D"select SF Certificate" xpath=
=3D"/html/body/div[@id=3D'header']/div[@id=3D'LangLogout']/form[@id=3D'lang=
Selectlist']/select/option[1]"/>
            </then>
        </ifStep>

The bolded code issues the following failure:

No suitable form found having field named "/html/body/div[@id=3D'header']/d=
iv[@id=3D'LangLogout']/form[@id=3D'langSelectlist']/select/."

while the storeXPath expression results in the following:

storeXPath
store english language property
property        defaultLang
xpath   /html/body/div[@id=3D'header']/div[@id=3D'LangLogout']/form[@id=3D'=
langSelectlist']/select/option/.
=3D> value        English (USA)


Am I doing something wrong, and if so how may I change it to have verifySel=
ectField return the corrent result?


Thanks.

--
I'm not the person your mother warned you about... her imagination isn't th=
at good!

--_000_93B3B6122B906D44BC7E8B8CEFB0DBBB1845056EA0SGPEXCHANGEpo_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">
<META content=3D"MSHTML 6.00.6000.16674" name=3DGENERATOR></HEAD>
<BODY>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SP=
AN=20
class=3D860293319-06082008>I see a few&nbsp;problems here.&nbsp; First, you=
r=20
verifySelectField should use the xpath attribute instead of the name attrib=
ute,=20
if you want to find it by xpath like your example.&nbsp; Second, I think yo=
ur=20
storeXPath's xpath is wrong for storing the value of the selected option.&n=
bsp;=20
Someone else emailed in to try and figure out how to store a value from a=20
dropdownlist: <A=20
href=3D"http://www.nabble.com/How-to-store-value-from-dropdownlist-to168346=
96.html#a16834696">http://www.nabble.com/How-to-store-value-from-dropdownli=
st-to16834696.html#a16834696</A></SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SP=
AN=20
class=3D860293319-06082008>Or you can just model after this one:=20
//td/select[@id=3D'Line_Of_Sight_Speed__INPUT_BOX']/option[@selected=3D'sel=
ected']"</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SP=
AN=20
class=3D860293319-06082008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SP=
AN=20
class=3D860293319-06082008>See if this info helps :)</SPAN></FONT></DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SP=
AN=20
class=3D860293319-06082008></SPAN></FONT>&nbsp;</DIV>
<DIV dir=3Dltr align=3Dleft><FONT face=3DArial color=3D#0000ff size=3D2><SP=
AN=20
class=3D860293319-06082008>Will</SPAN></FONT></DIV><BR>
<DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft>
<HR tabIndex=3D-1>
<FONT face=3DTahoma size=3D2><B>From:</B> webtest-admin@lists.canoo.com=20
[mailto:webtest-admin@lists.canoo.com] <B>On Behalf Of </B>Steve=20
Chikwaya<BR><B>Sent:</B> Wednesday, August 06, 2008 1:38 PM<BR><B>To:</B>=20
webtest@lists.canoo.com<BR><B>Subject:</B> [Webtest] Problems with=20
verifySelectField<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=3Dltr>Hi everyone,<BR><BR>I am having a problem with verifySelectF=
ield in=20
that it does not pick out the currently selected item in a drop down box.&n=
bsp;=20
The drop down is a list of 34 languages and based on the session, can be se=
t to=20
any one of those 34.&nbsp; When i try to use verifySelectField to check whi=
ch=20
select option is currently selected, i get the "No suitable form found havi=
ng=20
field named" error.&nbsp; storeXPath picks up the the correct language, but=
=20
verifySelectField does not seem to recognize the xpath.<BR><BR>here is my=20
code:<BR><BR>&lt;storeXPath<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;=20
description=3D"store english language=20
property"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;=20
xpath=3D"/html/body/div[@id=3D'header']/div[@id=3D'LangLogout']/form[@id=3D=
'langSelectlist']/select/option/."<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
property=3D"defaultLang" /&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;=20
&lt;ifStep description=3D"change language to English"&gt;<BR>&nbsp;&nbsp;&n=
bsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;condition&gt;<BR>&nbsp;&nbsp;&nbs=
p;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
<B>&lt;verifySelectField description=3D"Check for language drop down"=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
name=3D"/html/body/div[@id=3D'header']/div[@id=3D'LangLogout']/form[@id=3D'=
langSelectlist']//select/option/."=20
value=3D"English (USA)" /&gt;</B><BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=
=20
&nbsp;&nbsp;&nbsp; &lt;/condition&gt;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nb=
sp;=20
&nbsp;&nbsp;&nbsp; &lt;then&gt;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;setSelectField description=3D"sel=
ect SF=20
Certificate"=20
xpath=3D"/html/body/div[@id=3D'header']/div[@id=3D'LangLogout']/form[@id=3D=
'langSelectlist']/select/option[1]"/&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/then&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &lt;/ifStep&gt;<BR><BR>The bolded code issues the follow=
ing=20
failure:<BR><BR><B><I>No suitable form found having field named=20
"/html/body/div[@id=3D'header']/div[@id=3D'LangLogout']/form[@id=3D'langSel=
ectlist']/select/."</I></B><BR><BR>while=20
the storeXPath expression results in the following:<BR><BR><B>storeXPath</B=
>=20
<BR>store english language property=20
<TABLE cellSpacing=3D0 cellPadding=3D2>
  <TBODY>
  <TR>
    <TD class=3DparameterName>property</TD>
    <TD class=3DparameterValue>defaultLang</TD></TR>
  <TR>
    <TD class=3DparameterName>xpath</TD>
    <TD=20
      class=3DparameterValue>/html/body/div[@id=3D'header']/div[@id=3D'Lang=
Logout']/form[@id=3D'langSelectlist']/select/option/.</TD></TR>
  <TR>
    <TD class=3DparameterName>=3D&gt; value</TD>
    <TD class=3DparameterValue>English (USA)</TD></TR></TBODY></TABLE><BR=20
clear=3Dall><BR>Am I doing something wrong, and if so how may I change it t=
o have=20
verifySelectField return the corrent result?<BR><BR><BR>Thanks.<BR><BR>--=20
<BR>I'm not the person your mother warned you about... her imagination isn'=
t=20
that good!<BR></DIV></BODY></HTML>

--_000_93B3B6122B906D44BC7E8B8CEFB0DBBB1845056EA0SGPEXCHANGEpo_--