18 January 2026:


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.

type in value into a textbox that name changed dynamic during runtime

eureeure Members
edited November -1 in Sahi - Open Source
Hello;

Wondering how could I use the _setValue that having the textbox name changed every time?

the normal _setValue(_textbox("test-515"), "myTyping") can't be work as the number of '515' will be changing everytime i run the site. I had tried;

_setValue(_textbox("test-*"), "myTyping")

but doesn't work as well..

Any idea what we can use 'contain'?

Thank you.

Comments

  • you can use - _setValue(_textbox(/test-/), "myTyping")
  • Doesn't seem work for me... any thought? :(
    sumeet wrote:
    you can use - _setValue(_textbox(/test-/), "myTyping")
  • Hi eure,

    Trying using this :

    _setValue(_textbox(/test[-]/), "myTyping");

    Let me know if this solves your issue.

    Regards
    Sumitra
  • Thanks for your help to getting top of it, but unfortunately, no luck from there :(
    Sumitra wrote:
    Hi eure,

    Trying using this :

    _setValue(_textbox(/test[-]/), "myTyping");

    Let me know if this solves your issue.

    Regards
    Sumitra
  • narayannarayan Administrators
    Hi Eure,

    When elements are dynamically generated, try to use some other identifier for the element (from the alternatives dropdown). If that does not work either, use the _near API to find the element with respect to another on the browser. Please have a look at the top section here: http://sahi.co.in/w/browser-accessor-apis

    Regards,
    Narayan
Sign In or Register to comment.