2

I execute javascript below and it must return True or False and it would do the Run Keyword If the statement is False but what in ${CheckboxStatus} is None, instead of Boolean value True or False. Kindly enlighten me on this. Thanks.

 Verify Operator Checkbox
${CheckboxStatus}=      Execute Javascript  $('#operators').is(':checked')
Run Keyword If      '${CheckboxStatus}' == 'false'      Check Operator

Check Operator
Execute Javascript      $('#operators').click()
  • It is not clear what you are asking. – Embedded Aug 4 '16 at 9:53
3

The variable ${CheckboxStatus} is None because the script provided to Execute Javascript doesn't return anything. To fix it, add the return statement:

Verify Operator Checkbox
${CheckboxStatus}=      Execute Javascript  return $('#operators').is(':checked')
Run Keyword If      '${CheckboxStatus}' == 'false'      Check Operator

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.