Skip to content

Highlight and Wait

georgkunze edited this page Mar 25, 2020 · 6 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 your are not able to see whats 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 wether 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. Therfore it should be deactivated before testing them.

Clone this wiki locally