Skip to content

Highlight and Wait

RobertAvemarg edited this page Dec 13, 2024 · 7 revisions

Debugging Utils

Sometimes debugging or analyzing a test automation using Selenium based WebDriver can be cumbersome. You can't see which was the last selector that matched or the test execution is so fast that you are not able to see what's happening. For such cases we added the following feature.

Highlighting the current selection

Every element matching the current selector will be marked. This means that a chain of Selenide selectors results in a chain of highlighted elements. For example the following $('body').find('header'); will result in two highlights the first will mark the whole body while the second will mark only the header. Highlighting an element takes as long as the configured duration. Afterwards the highlights are reset so that nothing interferes with the next action. In case no duration is specified we use 100 milliseconds as default duration.

Configuration

The configurations are stored in the file config/neodymium.properties

Property Description
neodymium.debugUtils.highlight a boolean that decides weather or not a highlighting is activated
neodymium.debugUtils.highlight.duration is the duration of the highlight in milliseconds

Example

neodymium.debugUtils.highlight = true
neodymium.debugUtils.highlight.duration = 100

Highlighting and Shadow Dom

Highlighting currently does not work with shadow dom elements. Therefore, it should be deactivated before testing them.

Clone this wiki locally