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.
Identifying row in table and using to click link
Dear all,
Forgive me if this is a simple question - I'm still very much a Sahi newcomer!
In our application we have a number of pages with tables. One such table has say, 5 rows, each row may be mostly identical except for the first column. Also, each row has a link "Change to custom" in say, the 5th column.
What we need to do is find the row that has "testvalue" in the first column, and click the "Change to custom" link in the 5th column in that row.
Help?!?
Thanks
Forgive me if this is a simple question - I'm still very much a Sahi newcomer!
In our application we have a number of pages with tables. One such table has say, 5 rows, each row may be mostly identical except for the first column. Also, each row has a link "Change to custom" in say, the 5th column.
What we need to do is find the row that has "testvalue" in the first column, and click the "Change to custom" link in the 5th column in that row.
Help?!?
Thanks
This discussion has been closed.
Comments
Try
_click(_link("Change to custom", _near(_cell("testvalue"))));
or
_click(_link("Change to custom", _in(_row("/testvalue/"))));
Have a look at http://sahi.co.in/w/browser-accessor-apis to see how _near, _in etc. work.
Regards,
Narayan
That worked a treat!... Or at least it did, when I discovered case-sensitivity ;-)
Is it possible to "turn off" case sensitivity in situations like this? so that eg:
_click(_link("Change to custom", _near(_cell("testvalue"))));
_click(_link("Change TO custom", _near(_cell("testvalue"))));
_click(_link("Change to custom", _near(_cell("TESTvalue"))));
Would all work?
Unfortunately, due to a bug, case insenstive identifiers do not work right now. We will try to add support in the coming build.
Regards,
Narayan
No problem, not a major issue for us, but we'll look forward to the new build soon!