What is the difference between "hidden" and normal steps?

Iridium uses WebDriver, which provides a browser agnostic API for performing actions on elements in web pages. Actions like "click" in the WebDriver API have some restrictions, like requiring the element being clicked to be visible on the page.

Steps like the one below (without the word "hidden") make use of the WebDriver API.

And I click the element found by "Button"

Normally these restrictions are fine, but there are cases where you need to be able to click something that WebDriver determines is not clickable.

In these cases Iridium provides "hidden" steps (so called because they include the word "hidden", and not because the steps are restricted or not supported) which use JavaScript to emulate the click event. This bypasses the restrictions imposed by the WebDriver API, and means elements that would be considered unclickable by the WebDriver API can still be clicked as part of a test.

Steps like the one below with the word "hidden" bypass the WebDriver API and dispatch events manually via JavaScript.

And I click the hidden element found by "Button"

There are other situations where you want to click elements that WebDriver considers unclickable, so over time "hidden" steps have become a kind of fallback for cases where the WebDriver API is not suitable for replicating user interactions.

Typically you would reference normal steps in your test scripts, and only use the "hidden" steps as a fallback when you see errors like this:

org.openqa.selenium.WebDriverException: Element is not clickable at point (411, 675). Other element would receive the click: ...

Why does Chrome headless fail to find elements?

This is a known bug. See https://github.com/SeleniumHQ/selenium/issues/4477 for details.

results matching ""

    No results matching ""