In my framework project , i read the function name form excel file and execute the function through reflection concept .
try {
Method method;
method=app.getClass().getMethod(KeywordKey);
method.invoke(app);
}catch(Exception ex) {
Throwable c=ex.getCause();
System.out.println(c.getMessage());
}
Above code is executed successfully for first "KeywordKey" but give nullpointerexception for second "KeywordKey"
Instructor
Ashish Thakur Replied on 24/06/2019
NullPointerException comes when the code is not able to find the method(Function) name with the data specified in the method.invoke("function name")