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.

How to use regular Expressioin for changing cell values..

ootoot Members
edited November -1 in Sahi - Open Source
Hi ..
I m having problem with the values displayed for the cells in form .
The input which gets captured during recording is as below:

_cell(_table(77), 0, 0));
_cell(_table(77), 0, 2));
_cell(_table(77), 2, 0)));
_cell(_table(77), 6, 2)));


But when i re-run my script , the value in the _table (77) has changed and script fails .
The value (77) keeps changing from time to time (keeps increasing ).
How can i use regular Expression for this such that , the value remains constant .

Comments

  • Hi,

    If this is the only table in the page then you can use _table(\d*)

    Regards,
    Pankaj.
  • hi pankaj,

    i'am also facing the same problem . In my case i'am having number of tables in the same format . so is there any way to differentiate them.
    _cell(_table(45), 3, 2)));
    _cell(_table(67), 7, 4)));


    Regards
    Priya
  • Hi Priya,

    I havnt tried but I hope indexing should help. eg.
    _cell(_table(\d*[0]), 3, 2)));
    _cell(_table(\d*[1]), 7, 4)));
    Just check it..am not sure about it.
  • narayannarayan Administrators
    Oot and Priya,
    It seems like the table does not have any id for Sahi to identify it uniquely. That is why it uses the index. I guess there will be something else of interest in the table row which can identify your table cell. If yes, paste the html and let us see if we can find a useful javascript function to identify the table.
    -Narayan
Sign In or Register to comment.