18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Dynamic Generation Of Control ID
Hi folks,
I am trying to set a the value of a text box that changes each time the page is loaded. Such as the following:
_setValue(_textbox("customer[addresses_attributes][1348058693509][line_1]"), "234");
I have tried doing a regular match on this, but I can't seem to get it to work.
Is there a way of finding the control each time?
Kind regards,
I am trying to set a the value of a text box that changes each time the page is loaded. Such as the following:
_setValue(_textbox("customer[addresses_attributes][1348058693509][line_1]"), "234");
I have tried doing a regular match on this, but I can't seem to get it to work.
Is there a way of finding the control each time?
Kind regards,
This discussion has been closed.
Comments
Try with this
_setValue(_textbox("/customer\[addresses_attributes\]\[.*\]\[line_1\]/"), "234");
or
_setValue(_textbox("/customer\\[addresses_attributes\\]\\[.*\\]\\[line_1\\]/"), "234");
Square brackets have a special meaning in regular expressions. So they need to be escaped.
Regards,
Narayan
Thank you for getting back to me quickly.
The second solution works perfectly.
Many thanks,
Steve