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 textbox value for input field in a table with ID generated randomly

simi823simi823 Members
edited April 2013 in Sahi - Open Source
Here is the part of the table that I need to access:
<td align="left">Pathfinder (A)</td>
<td align="right" class="scoreboard_score"><input type="text" size="4" maxlength="32" name="s3332529" value="" /></td>
<td align="left">SAHI18cb5c0b-cd33-44a1-9905-84b6f81ea887 (H)</td>
<td align="right" class="scoreboard_score"><input type="text" size="4" maxlength="32" name="s3332528" value="" /></td>

I need to set the value of the textbox with name "s3332529" or "s3332528", but these values change randomly.

I tried this but it does not work:
_setValue(_textbox(_near(_cell("Pathfinder (A)"))), "5");

Please Help!

Best Answer

  • Hi

    it must be _setValue(_textbox(0, _near(_cell("Pathfinder (A)"))), "5"); where 0 is he index, speak 'first textbox near ...."
    put _textbox(0, _near(_cell("Pathfinder (A)"))) in your access field in the sahi controller and click highlight to check it its the right element

    regards
    wormi

Answers

Sign In or Register to comment.