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.
isDisabled not working
I'm trying to verify that a button is disabled on a page. I've tried for the past 3+ hours without any luck. It's very weird because I can get it to work when I run the commands through the 'Record' tab of the Sahi Controller, but not through the 'Playback' tab.
I've tried the following:
1) _button("Copy").isDisabled
2) _button("Copy").disabled
3) _button("Update Devices").outerHTML.containsText(/disabled=true/)
When run through the Playback tab with a .sah script, I always get the message: TypeError: Cannot call method "containsText" of undefined.
Please help!
I've tried the following:
1) _button("Copy").isDisabled
2) _button("Copy").disabled
3) _button("Update Devices").outerHTML.containsText(/disabled=true/)
When run through the Playback tab with a .sah script, I always get the message: TypeError: Cannot call method "containsText" of undefined.
Please help!
This discussion has been closed.
Comments
Use _call(_button("button").disabled);
Regards,
dkulkarni
Could you check if your application's button works like the one specified in this link?
These usages work for the example.
Is it possible for you to point us to an online example, similar to the one in your application?
Regards,
dkulkarni
I ended up using:
_set($isDisabled, _button("Button").isDisabled);
if ($isDisabled == true)
{
// Button is disabled
}
else
{
// Button is enabled
}
For using DOM variables in conditions, you will need to use the _condition API.
Refer this for more details.
Regards,
dkulkarni