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.

set value for a text box under a link

ernest.jebaernest.jeba Members
edited November -1 in Sahi - Open Source
Hi,


In a page, there are lot of text boxes and its id will get changed every time once the page refreshed.
I need to assign a value to a particular text box which is below a link.
_setValue(_textbox("undefined[4]"), "value"); // using the sahi IDE
where as the link accessor is _link("Observation[5]"));

I have tried by

_setValue(_textbox(_under(_link("newlink[5]")), "value"));
_setValue(_under(_link("newlink[5]"))_textbox, "value");

I am getting Exception error and in sometime undefined.

Kindly help me out to handle the above scenario.

Comments

  • can you try with
    _setValue(_textbox(0, _under(_link("newlink[5]")), "value"));

    Regards,
    Tejas
  • Thanks Tejas

    When I try with the above way, I am getting "undefined"
  • Hi,

    Can you find another way to represent the link under which the textbox is there. Or if you can point us to the application you are working on, we may suggest a better and robust way for setting the value.

    I would suggest that you should go for the most stable DOM relation such as referring the textbox in right, under or near some well defined label or link or button etc. Or you may try to set the textbox inside a div.

    Thanks,
    Vivek
Sign In or Register to comment.