Retrieving elements after a zone update changed their id.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Retrieving elements after a zone update changed their id.

Davide Vecchi-2
Hi everybody,

We are using Tapestry 5.4.3 (successfully migrated from 5.3.8, just for the record).

I am writing Selenium tests for this webapp and I am having a problem related to the fact that after a zone update Tapestry changes the client id of the elements, like explained in detail under "What's that weird number in the middle of the client ids after a Zone is updated?" in the doc at .

I have a page with a form, containing a zone, containing let's say a dropdown ('<select>') and a text field ('<input type="text" id="myFieldId" ...>').

The dropdown in the .tml has 't:zone="myZone"', so when one of its entries is selected, the zone is updated.

My test goes to that page, retrieves the text field by its id, reads its value, selects a dropdown entry, and tries to retrieve the value of the text field again (to make sure it has the expected new value), but this last step fails because the id of that field has changed (and to something unpredictable).

Are there better solutions than adding a "custom" attribute in the tags of all those elements in the .tml, or trying to locate elements in other ways instead of by id ?

Thanks in advance for any possible thought.