[Webtest] prefer to use storeXPath than storeRegEx
Denis N. Antonioli
Denis N. Antonioli" <denis.antonioli@canoo.com
Mon, 13 Aug 2007 21:20:45 +0200
Hi Michael
That was the best thread on the mailing list for a long time ;-)
If you don't need the value of #{selectBox} in an other place, you =20
may even try to use something like:
<setSelectField
=
xpath=3D"//td[@title=3D'#{stage.name}']/following-sibling::td/select"
text=3D"${chewi.release.stage2.name}"
/>
Best
dna
On 13 ao=FBt 07, at 11:39, Michael Habbert wrote:
> Hi all,
>
> I found a way to access the selectbox directly with xpath, so I do =20
> not need the row-number any more.
>
> -------------------
> <storeXPath description=3D"get the selectbox-name for the new element"
> xpath=3D"//td[@title=3D'#{stage.name}']/following-sibling::td/select/=
=20
> @name" property=3D"selectBox" />
> <setSelectField description=3D"Select option Rel Stage Name 2" name=3D"#=
=20
> {selectBox}"
> text=3D"${chewi.release.stage2.name}" />
> -------------------
>
> thanks to everybody - thinking about my request - I found the =20
> solution by my own.
>
> The trick is the right, smart xpath-expression.
>
> yours
>
> Michael Habbert
>
> Michael Habbert wrote:
>> Hi again;-),
>> what I want to achive is:
>> there is a row inside my table with
>> one field with my new string - helps me to identify the line (and =20
>> extract the row-number) and
>> one select-box I want to change.
>> my old doing was:
>> 1. Identify the row by accessing the id-tag of the first element =20
>> identified by my well-known string.
>> 2. change the value of the select-box in this row (and no element =20
>> in any other row ;-).
>> <setSelectField description=3D"Select option Rel Stage Name 2" =20
>> name=3D"dependency[#{row.number}].releaseStageID" text=3D"$=20
>> {chewi.release.stage2.name}" />
>> this is may be a better introduction to the first request for =20
>> support with my webtest-improvement.
>> thanks,
>> Michael Habbert wrote:
>>> Hi all,
>>>
>>> I run into a webtest-failure caused by a change in the jsp-=20
>>> page ;-) I did.
>>> So I'm thinking about change the the test who uses a storeRegEx =20
>>> to identify the line-number of an element I added to the list bevor:
>>> ---------------
>>> <storeRegEx description=3D"extract the row-number of the last cr-=20
>>> stage-row."
>>> text=3D"<td\sid=3D"row(\d)"=20
>>> \sclass=3D"tabelle"\swidth=3D"300"\stitle=3D"=
#=20
>>> {stage.name}">" group=3D"1" property=3D"row.number" =20
>>> propertyType=3D"dynamic" />
>>> ----------------------
>>>
>>> so this time the html-code changed on space did become a newline.
>>>
>>> Is there a way to extract the line-number coded into the id-tag =20
>>> of the td-tag for example:
>>> <td id=3D"row7" ...bla...bla>
>>>
>>> If I identify the value with storeXPath I do have: row7 whereas =20
>>> storeRegEx gives me 7. Any Ideas who to get the seven using =20
>>> storeXPath? or I am stuck with storeRegEx and adjust over and =20
>>> over again?
>>>
>>> thanks for all ideas.
>>>
>
>
>
> --=20
> Mit freundlichen Gr=FC=DFen
>
> Michael Habbert
>
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
--=20
Are you confusing a structure definition with some pixel
layout system? HTML is not a pixel layout system.
-- Tom Christiansen in <37208e2a@cs.colorado.edu>