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.
identifier functions in Sahi script
I am exploring Sahi and would like to know how to extend Sahi script. We have an application that changes the ids of UI elements on a page when design changes are made. Here is an example
<input id="mx726" ctype="textbox" li="mx727" type="text" class="text ib" value="" title="WO Description"/>
The id might change to "mx678" for this text input box however the title rarely changes. I have looked thru the apis but it is unclear to me how to extend the Sahi script functions to include identifiers by title. Would someone offer some suggestions to get started? Thanks from a Sahi newbie.
<input id="mx726" ctype="textbox" li="mx727" type="text" class="text ib" value="" title="WO Description"/>
The id might change to "mx678" for this text input box however the title rarely changes. I have looked thru the apis but it is unclear to me how to extend the Sahi script functions to include identifiers by title. Would someone offer some suggestions to get started? Thanks from a Sahi newbie.
Comments
There are various attributes by which Sahi identifies elements. The first default for most elements is id. But if you look at the Alternatives dropdown on the Controller, you will see the various other identifiers for the same element.
If you want to prevent ids from being used as default, Sahi allows a way to ignore specific ids which may match a pattern.
Open sahi/htdocs/spr/concat.js
Search for isIgnorableId. You will see a function like this:
Add your own expression to the list of regular expressions. Eg. if you want to ignore ids which start with mx, then add id.match(/^mx/) so that your function now looks like:
Restart Sahi, clear browser cache and Sahi will ignore ids which start with mx.
Regards,
Narayan