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
Hi,
I am working with Jenkins plugin 2.28.1.
My tests are with TestNG and I using version 2.13
I add Listener to my testng.xml and create 2 Attachment methods called from onTestFailure
I also add @step for one of the methods called by the test.
In The Execution part I see the Set up and Tear Down part but I dont see the test body.
Also I dont see the output (screenshot and text) from the listener.
The history is also empty.
Thanks
@Override
public void onTestFailure(ITestResult result) {
saveScreenshotPNG();
saveText(result.getThrowable().getMessage());
}
@Attachment(value = "Failure Screenshot", type = "image/png")
public byte[] saveScreenshotPNG() {
TakesScreenshot driver = (TakesScreenshot) GeneralVars.getDriver();
return driver.getScreenshotAs(OutputType.BYTES);
}
@Attachment(value = "Failure text", type = "text/plain")
public String saveText(String exception) {
return "Listener " + exception;
}
Activity