Hi!

Is there a part of the id values that is unique and consistent?  If
so, you could use a regex.  For example if your id is 'field_id_XXX'
where XXX is a number that is auto-generated:

browser.text_field(:id, /field_id/).set('My Text')

Are there other attributes that are available (:name, :class, etc)?

If you know how many of each object exists and their order is
consistent, you could get the id this way:

browser.text_field(:index, 1).attribute_value('id')

Otherwise, maybe you could learn how the ids are generated and try to
build some code to model that.

Hope this helps!

-Tiffany

On Feb 17, 3:00 pm, tester86 <sagar.am...@gmail.com> wrote:
> Hi
>
> I came across that example before on automation frameworks. I have
> already started to implement a framework. But my question was is there
> any way Watir supports automatically generated ID's?
>
> Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general

Reply via email to