You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.util.concurrent.ExecutionException: java.lang.NullPointerException: No BaseStepListener has been registered : Throwing this exception under Java's Callable interface call() method with Serenity
#2203
Closed
nitin1989 opened this issue
Aug 16, 2020
· 5 comments
Hi ,
I am getting below exception on using Callable interface call() method implemetation with Serenity.
java.util.concurrent.ExecutionException: java.lang.NullPointerException: No BaseStepListener has been registered
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at com.serenity.test.cucumberStepDefinitions.api.EmployeeGlue.i_hit_API_n_times_with_body_data_as(EmployeeGlue.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cucumber.runtime.Utils$1.call(Utils.java:26)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:20)
Below is the code I am using inside Callable interface's call() method:
@OverRide
public String call() throws Exception
{
Response res=null;
StringBuilder sb = new StringBuilder();
res=employee.createNewEmployee(url,payload); // Calling to POST API to create employees
JsonPath jsonpath = res.jsonPath();
String name = jsonpath.get("name");
sb.append("API Response : ").append(res.asString()).append('\n');
sb.append("Name : ").append(name).append('\n'); Serenity.recordReportData().withTitle("Employee Creation : ").andContents(sb.toString()); // Exception thrown here.
return name;
}
Exception is getting thrown in above code when logging content in Serenity report(Line of code highlighted above in bold)
The text was updated successfully, but these errors were encountered:
Ok. Is there any workaround for logging the content in Serenity report, since its not even logging the API request and response in Serenity report on using SerenityRest class within Callable implementation.
Hi ,
I am getting below exception on using Callable interface call() method implemetation with Serenity.
java.util.concurrent.ExecutionException: java.lang.NullPointerException: No BaseStepListener has been registered
at java.util.concurrent.FutureTask.report(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at com.serenity.test.cucumberStepDefinitions.api.EmployeeGlue.i_hit_API_n_times_with_body_data_as(EmployeeGlue.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cucumber.runtime.Utils$1.call(Utils.java:26)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:20)
Below is the code I am using inside Callable interface's call() method:
@OverRide
public String call() throws Exception
{
Response res=null;
StringBuilder sb = new StringBuilder();
res=employee.createNewEmployee(url,payload); // Calling to POST API to create employees
JsonPath jsonpath = res.jsonPath();
String name = jsonpath.get("name");
sb.append("API Response : ").append(res.asString()).append('\n');
sb.append("Name : ").append(name).append('\n');
Serenity.recordReportData().withTitle("Employee Creation : ").andContents(sb.toString()); // Exception thrown here.
return name;
Exception is getting thrown in above code when logging content in Serenity report(Line of code highlighted above in bold)
The text was updated successfully, but these errors were encountered: