0

I'm new to Robot Framework and Selenium. I can not set a checkbox. There are several settings, which is controlled by the checkbox. I see that it was set by Robot, but the result is not stored. The test is successful. In manual test if check box was set, the result was stored. I used 5 different locators for checkbox with the same result. I will be glad to any ideas.

Wait Until Page Contains Element  |  id=submitBtn
Select Checkbox                   |  xpath=(//input[@type='checkbox'])[3]
Checkbox Should Be Selected       |  xpath=(//input[@type='checkbox'])[3]
sleep                             |  7s
Click Element                     |  id=submitBtn                        |  5s 
3
  • Do you get any errors in your log? Feb 23 '16 at 17:35
  • In addition to the log, by default the framework makes a screenshot of the state of the page when the test execution fails. Is the checkbox correctly checked in that screenshot? It's possible that the check happens before the 'state' of the page has changed to reflect that the checkbox is now selected, so you may need a small sleep in there. The 7s sleep before clicking the submit button seems out of place there btw...
    – Cronax
    Feb 25 '16 at 11:56
  • Thank you very much for your answer. Sleep 7s is needed to have time to see by eyes that the checkbox is set. Сheckbox correctly checked, but his state does not save by website. When checkbox manually setting its state is saved in database. Test runs without errors. May be there is a difference in selenium between "select" the checkbox and "set" the checkbox? Feb 25 '16 at 14:01
1

Try using the locator of the check box with keyword click element instead of Select checkbox.

Click Element | xpath=(//input[@type='checkbox'])[3]

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.