[Webtest] xpath

Gary Stillings Gary Stillings <garys951@hotmail.com>
Tue, 15 Jul 2008 08:15:48 -0600


--_acd68518-295d-46ec-bd83-ca520d593a6b_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Janet=2C

i don't know if it would be any help but xpathexplorer is a big help for tr=
icky x paths. and my team and i ran in to an issue with badly formated html=
 code. we had an issue were webtest could not select a raidio button becaus=
e of how it was imbeded in a table imporerly. try running jtidy on your cod=
e and making sure it is at standereds be4 uing webtest. i hope this helps i=
n some way.

gary stillings

> From: mguillemot@yahoo.fr
> To: webtest@lists.canoo.com
> Subject: Re: [Webtest] xpath
> Date: Tue=2C 15 Jul 2008 09:34:39 +0200
>=20
> Janet=2C
>=20
> your first XPath doesn't select a select field and the second one seems
> invalid to me. Try in you browser to find the right XPath expression
> allowing to select your select/option.
>=20
> Cheers=2C
> Marc.
> --=20
> Blog: http://mguillem.wordpress.com
>=20
>=20
> Janet Gregory wrote:
> > Hi folks=2C
> >=20
> > I'm new to
> >=20
> > webtest and to ajax=2C and am trying to figure out how to select a row =
in
> > a table. The xpath that xpathchecker gives to me looks like this=2C and
> > points to a single instance of Quality Assurance.
> >=20
> > "     id('
> >=20
> > userAvailableRolesTable')/tbody/tr[5]/td[2] "
> >=20
> > Can anyone tell me how to turn that statement into a
> >=20
> > webtest select. I feel like I'm doing a bit of trial and error here=2C =
and
> > this is one of my "trials". If someone can shortcut my learnings=2C I
> > would appreciate it... or point me to a nice library that shows me how
> > to translate into webtest speak.
> >=20
> >  "<
> >=20
> > setSelectField=20
> > xpath=3D"//select[@id=3D['userAvailableRolesTable']/tbody/tr[5]/td[2]"
> > value=3D"Quality Assurance" /> "
> >=20
> > thx=2C
> >=20
> > Janet
> >=20
>=20
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest

_________________________________________________________________
Need to know now? Get instant answers with Windows Live Messenger.
http://www.windowslive.com/messenger/connect_your_way.html?ocid=3DTXT_TAGLM=
_WL_messenger_072008=

--_acd68518-295d-46ec-bd83-ca520d593a6b_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style>
.hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt=3B
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class=3D'hmmessage'>
Janet=2C<br><br>i don't know if it would be any help but xpathexplorer is a=
 big help for tricky x paths. and my team and i ran in to an issue with bad=
ly formated html code. we had an issue were webtest could not select a raid=
io button because of how it was imbeded in a table imporerly. try running j=
tidy on your code and making sure it is at standereds be4 uing webtest. i h=
ope this helps in some way.<br><br>gary stillings<br><br>&gt=3B From: mguil=
lemot@yahoo.fr<br>&gt=3B To: webtest@lists.canoo.com<br>&gt=3B Subject: Re:=
 [Webtest] xpath<br>&gt=3B Date: Tue=2C 15 Jul 2008 09:34:39 +0200<br>&gt=
=3B <br>&gt=3B Janet=2C<br>&gt=3B <br>&gt=3B your first XPath doesn't selec=
t a select field and the second one seems<br>&gt=3B invalid to me. Try in y=
ou browser to find the right XPath expression<br>&gt=3B allowing to select =
your select/option.<br>&gt=3B <br>&gt=3B Cheers=2C<br>&gt=3B Marc.<br>&gt=
=3B -- <br>&gt=3B Blog: http://mguillem.wordpress.com<br>&gt=3B <br>&gt=3B =
<br>&gt=3B Janet Gregory wrote:<br>&gt=3B &gt=3B Hi folks=2C<br>&gt=3B &gt=
=3B <br>&gt=3B &gt=3B I'm new to<br>&gt=3B &gt=3B <br>&gt=3B &gt=3B webtest=
 and to ajax=2C and am trying to figure out how to select a row in<br>&gt=
=3B &gt=3B a table. The xpath that xpathchecker gives to me looks like this=
=2C and<br>&gt=3B &gt=3B points to a single instance of Quality Assurance.<=
br>&gt=3B &gt=3B <br>&gt=3B &gt=3B "     id('<br>&gt=3B &gt=3B <br>&gt=3B &=
gt=3B userAvailableRolesTable')/tbody/tr[5]/td[2] "<br>&gt=3B &gt=3B <br>&g=
t=3B &gt=3B Can anyone tell me how to turn that statement into a<br>&gt=3B =
&gt=3B <br>&gt=3B &gt=3B webtest select. I feel like I'm doing a bit of tri=
al and error here=2C and<br>&gt=3B &gt=3B this is one of my "trials". If so=
meone can shortcut my learnings=2C I<br>&gt=3B &gt=3B would appreciate it..=
. or point me to a nice library that shows me how<br>&gt=3B &gt=3B to trans=
late into webtest speak.<br>&gt=3B &gt=3B <br>&gt=3B &gt=3B  "&lt=3B<br>&gt=
=3B &gt=3B <br>&gt=3B &gt=3B setSelectField <br>&gt=3B &gt=3B xpath=3D"//se=
lect[@id=3D['userAvailableRolesTable']/tbody/tr[5]/td[2]"<br>&gt=3B &gt=3B =
value=3D"Quality Assurance" /&gt=3B "<br>&gt=3B &gt=3B <br>&gt=3B &gt=3B th=
x=2C<br>&gt=3B &gt=3B <br>&gt=3B &gt=3B Janet<br>&gt=3B &gt=3B <br>&gt=3B <=
br>&gt=3B _______________________________________________<br>&gt=3B WebTest=
 mailing list<br>&gt=3B WebTest@lists.canoo.com<br>&gt=3B http://lists.cano=
o.com/mailman/listinfo/webtest<br><br /><hr />Need to know now? Get instant=
 answers with Windows Live Messenger. <a href=3D'http://www.windowslive.com=
/messenger/connect_your_way.html?ocid=3DTXT_TAGLM_WL_messenger_072008' targ=
et=3D'_new'>IM on your terms.</a></body>
</html>=

--_acd68518-295d-46ec-bd83-ca520d593a6b_--