You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Davide Vecchi <dv...@amcbanking.com> on 2017/07/27 10:53:28 UTC

Retrieving elements after a zone update changed their id.

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 http://tapestry.apache.org/ajax-components-faq.html .

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.