Is it possible to interact with hidden elements with capybara?

前端 未结 7 1009
孤街浪徒
孤街浪徒 2021-02-06 21:08

I have a file field that has opacity: 0 and is overlaping a fake button. Its a common css technic to fake a sort of \"Upload button\" that displays consistently acr

7条回答
  •  自闭症患者
    2021-02-06 21:45

    I've done it this way with elements that has the CSS style display:none; set:

    page.execute_script("$('.all-hidden-elements').show();");
    all('.all-hidden-elements').first.click
    

提交回复
热议问题