yes u can check the status of the button ,u need to take the info from the application and u need to compare it with the actual value.
say u have a OK button which is enabled, u need to check whether its enabled or not.
u can write a fnction
public function button_check(in object, in status)
{
auto value;
button_get_info(object,"enabled",value);
if(status==value)
{
tl_step("button status check",PASS,"button is enabled");
return E_OK;
}
else
{
tl_step("button status check",FAIL,"button is not enabled");
return E_GENERAL_ERROR;
}
}
call this function
button_check("OK","1")
any doubts pls revert
Login to rate this answer.
I think the answer mentioned above is wrong.
As above script checks whether the button is enbled or disabled and not the button is pressed or not.
As pressing button does not necesarily disbled it.
Login to rate this answer.
Checking button wether it was pressed or not depends on behavior of button when pressed, its correct we can not always check the state of button, but if button is changing its state from enabled to disabled then the function mentioned in first answer can be used.
Else we can also check what are the changes happening after pressing the button (say color of button, button label, any pop-up, any other updation on page/application, any updation in database etc.) to make sure button was pressed.
Regards,
-AK
Login to rate this answer.