Element not found – the selector of this element can be fixed
This is the simpler case. The selector has been modified and should be fixed. The only thing you have to do is click on the appropriate UI element.
In the example below, we filter for Foundation 4.0. However, the selector for Apply has been modified:
Just click on ‘Apply’ and the selector is fixed:
Element not found – an earlier step causes the fault
In this case, if the failed step is not the first one, let’s clear the automation of this action or response and execute the test. If it doesn’t work, then redo this step and try the previous one. Only steps including actions (then) should be considered. The faulty low-level step is not far away from the one, the failure has been exposed.
In the example below, the selector cannot be found on the screen:
Instead of clicking on the UI element (that is not on the screen), we click on ‘Fail’. Then, we should clear the automation of the previous action, i.e., select ‘German as the second language’. After re-implementation, the test passes.
Note that the problem was that the selector for the UI element we clicked on had been changed, but the original selector remained valid, causing a faulty execution.
The same problem happens after re-implementation
In this case, the problem is probably that a validation step is missing, see ‘We should wait for a UI element to make an action’.