1. Trust your code and doubt SUT (Software under test):
If everything was working fine and the test starts to fail suddenly. Instead of debugging your code for issues, start with checking the actual product. Do some visual inspection and see whether the development team has modified the element or the element is no longer being displayed.
2. Trust your ...
PDHide's answer is good in general, but since you specifically ask about verifying selectors, I would like to add that you can test them in a browser console. For CSS selectors, you can test with
For XPath, you can test with
Each of these will return the first matching ...
Debugging is a basic skill programmers should have. Many testers lack programming skills because companies throw people with no or only little programming experience into test automation and expect them to learn such skills themselves.
Debugging is then one of many programming skills they lack. For instance, the problem with ...
First of all, we need to understand the root cause of the exception.
As written in the Selenium docs, it's thrown by FindElement/FindElements methods.
That might be caused by:
Invalid locator. In this case, you have to manually verify its validity on the page.
Absence of element within the DOM at the moment of the FindElement call. In other words, your ...
In addition to the other answers, for me the most efficient way to take a screenshot when a test fails and attach to the report. (When using cucumber its easily done with the After hook)
This way I can go to the CI, view the report and quickly understand what happened.
Debugging in terms of Lay man's(i.e. manual tester) language is to find the root cause of any issue/bug by following the steps or by observing the screenshot, GIF or video provided. So, in the similar manner various things are involved in debugging for which one can follow these points:
If your Automation framework has an ability to generate screenshot, ...
Show the benefits
I think the problem is frequently the incentive (I mean personal one not compensation) is not clear. When you make the incentive(s) clear the case makes itself, and the motivation is now there for anyone to take advantage of (but it's always a two way street). This is similar to trying to get good commit messages. Put someone in the ...