Capybara: Unable to find css

前端 未结 6 1271
被撕碎了的回忆
被撕碎了的回忆 2021-01-03 18:16

I am using capybara to click a checkbox, however it can\'t seem to find it no matter what I do. I am able to correctly find both the span and the label inside the span, but

6条回答
  •  长情又很酷
    2021-01-03 18:50

    Try this page.execute_script("$('#agreement').attr('checked', true)"). To make this work you should tag your examples with js: true

提交回复
热议问题