How to force Selenium WebDriver to click on elemen

2019-01-02 14:55发布

I am using Selenium 2 Java API with FirefoxDriver. When I fill a form, checkboxes are added to the page depending the forms inputs.

I'd like to simulate a click on those checkboxes using Selenium. The element are visible and usable in a regular browser but, selenium asserts that the elements are not visible.

"Element is not currently visible and so may not be interacted with"

Can I force selenium to ignore the non-visible state of the elements? How can I force Selenium to interact with the non-visible element?

13条回答
不流泪的眼
2楼-- · 2019-01-02 15:41

I just solve this error while using capybara in ror project by adding:

Capybara.ignore_elements = true

to features/support/env.rb.

查看更多
登录 后发表回答