My test automation returns NullPointerException
.
What are Null Pointer Exceptions (java.lang.NullPointerException
) and what causes them?
What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
You may think this too generic and lacks details but similar question exists on Stackoverflow and given the number of votes it appears helpful to others.
Also, we have plenty of questions about this topic on this site:
- NullPointerException in RequestSpecification
- Seeing NullPointerException on running TestNG Selenium Framework
- java.lang.NullPointerException - at com.qa.factory.factory.DriverFactory.init_driver(DriverFactory.java:26)
- How to debug NullPointerException in selenium-java
- NullPointerException - how to fix it?
- NullPointerException when using @FindBy
While I understand that many of our posters here have little coding experience (see similar discussion on SQA Meta), I also notice that such questions are very specific to the author code base and environment. This makes answers to such questions very specific and thus hard to generilize to other setups.
With such a generic question I am looking for answers that will provide basic troubleshooting steps that can be used in many custom setups.