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.
Custom Attribute is not recognized - Is there any issue?
I am trying to make sahi recognize a custom attribute called "data-aid" to identify all the elements in my web application.
But Sahi is not able to recognize elements by this custom attribute.
I have modified the concat.js file as below.
this.addAD({tag: "LABEL", type: null, event:"click", name: "_label", attributes: ["data-aid", "sahiText", "id", "className", "index"], action: "_click", value: "sahiText"});
this.addAD({tag: "LI", type: null, event:"click", name: "_listItem", attributes: ["data-aid", "sahiText", "id", "className", "index"], action: "_click", value: "sahiText"});
this.addAD({tag: "DIV", type: null, event:"click", name: "_div", attributes: ["data-aid", "sahiText", "id", "className", "index"], action: "_click", idOnly: false, value: "dataAID"});
Previously I was able to add title as attribute to recognize elements and it was successful.
Please let me know the solution is quite urgent.
regards,
rahoolm
But Sahi is not able to recognize elements by this custom attribute.
I have modified the concat.js file as below.
this.addAD({tag: "LABEL", type: null, event:"click", name: "_label", attributes: ["data-aid", "sahiText", "id", "className", "index"], action: "_click", value: "sahiText"});
this.addAD({tag: "LI", type: null, event:"click", name: "_listItem", attributes: ["data-aid", "sahiText", "id", "className", "index"], action: "_click", value: "sahiText"});
this.addAD({tag: "DIV", type: null, event:"click", name: "_div", attributes: ["data-aid", "sahiText", "id", "className", "index"], action: "_click", idOnly: false, value: "dataAID"});
Previously I was able to add title as attribute to recognize elements and it was successful.
Please let me know the solution is quite urgent.
regards,
rahoolm

Answers
[Exception] TypeError: Unable to get value of the property 'style': object is null or undefined
No trace available
Suppose my html code is like below
<div class="east" data-aid="compass_east_btn"></div>;
Expression I am trying to evaluate is
_highlight(_div("compass_east_btn"));
I get the above error.
Currently it is just recognizing the element as _div("east")
east is the class of the element.
It is like above in the first post.
Is there anyway to edit a post or answer once it is posted?
It is working with the latest version of Sahi Pro.
Get the concat.js from the latest version and compare it with yours.
I think it should work.
Regards,
Rahul
Any new attribute that you add, its name needs to be entered in sahi/config/normal_functions.txt.
Regards.
normal_functions.txt contains functions not attributes