Tell me more ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I am using robot framework. How can I test if a checkbox is selected? I want to run a keyword if a checkbox is selected like:

 ${checked} =   Checkbox Should Not Be Selected  xpath=.//*[@id='0,1,1,6']/td[11]/input
    Run Keyword if  '${checked}'  Click Element  xpath=.//*[@id='0,1,1,6']/td[11]/input  and wait

i.e. to click there if is not already clicked.

(The code of above is wrong, I know)

share|improve this question

1 Answer

From: http://rtomac.github.com/robotframework-selenium2library/doc/Selenium2Library.html

Keyword: Checkbox Should Be Selected

Arguments: locator

Documentation: Verifies checkbox identified by locator is selected/checked. Key attributes for checkboxes are id and name. See introduction for details about locating elements.

share|improve this answer
Thanks for answering. As you can see I am using "Checkbox should be selected" in my code (in fact I am using the negation). This command works like an assertion and not a question. When the assertion fails the test stops. I want to ask if the checkbox is checked and not to assert that the checkbox should be checked. – Luixv Feb 24 at 7:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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