18 January 2026:


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.

if disabled

rambabu81rambabu81 Members
edited November -1 in Sahi - Open Source
in my homepage there are 2 buttons clockin,clockout...if clockin is disable need to click on clockout
in this case if condition is not working..can u plse gave me the solution
var $value = _imageSubmitButton("ctl00\$btnClockIn").disabled;
_alert($value);
if ($value=="true"){
_click(_imageSubmitButton("ctl00\$btnClockOut"));
}
else
{
_click(_imageSubmitButton("ctl00\$btnClockIn"));
}

Comments

  • narayannarayan Administrators
    This query is not related to the Vista thread, so moving it out.

    Rambabu,

    Please start a new topic if your query is unrelated to the previous one. It confuses everyone and you may not get an answer to your question.

    Please have a look at _set and _condition APIs for your problem.

    In this case, you can use
    var $value
    _set($value, _imageSubmitButton("ctl00\$btnClockIn").disabled);
    _alert($value);
    if ($value==true){
       _click(_imageSubmitButton("ctl00\$btnClockOut"));
    }
    else
    {
    _click(_imageSubmitButton("ctl00\$btnClockIn"));
    }
    

    OR
    
    if (_condition(_imageSubmitButton("ctl00\$btnClockIn").disabled)){
       _click(_imageSubmitButton("ctl00\$btnClockOut"));
    }
    else
    {
    _click(_imageSubmitButton("ctl00\$btnClockIn"));
    }
    
    

    Regards,
    Narayan
Sign In or Register to comment.