NullPointerException | Selenium Forum
M
Posted on 09/01/2016
Hi, I followed your video 20 and trying to create the DataDriven Project,

While Creating DataProvider class for all the suites in one class file, i have been receiving the below Error.


java.lang.RuntimeException: java.lang.NullPointerException

SKIPPED: validateRunmode
org.testng.TestNGException:
Method validateRunmode requires 3 parameters but 0 were supplied in the @Test annotation.

I tried to Debug but unable to find the solution

Could you please fix it, i am attaching my project in zip file,

Thanks in Advance.
Siva

M
Replied on 10/01/2016

A NullPointerException means that one of the variables you are passing is null, but the code tries to use it like it is not.

For example, If I do this:
[quote:3c7rb0w6]
Integer myInteger = null;
int n = myInteger.intValue();[/quote:3c7rb0w6]
The code tries to grab the intValue of myInteger, but since it is null, it does not have one: a null pointer exception happens.

What this means is that your getTask method is expecting something that is not a null, but you are passing a null. Figure out what getTask needs and pass what it wants!