When I do:
@Override
public void onTestFailure(ITestResult result) {
// WebDriver driver = null;
try {
Object instance = result.getInstance();
if (instance instanceof BaseTest) {
WebDriver driver = ((BaseTest) instance).getDriver();
if (driver != null) {
screenshotUtility = new ScreenshotUtility(driver);
String testName = result.getName();
screenshotUtility.captureScreenshot(testName);
String errorMessage = result.getThrowable().getMessage();
Allure.addAttachment("Error Message", errorMessage);
...
}
}
the driver is found, and is the same as in Base Test. enter image description here
but there is still no screenshot in Allure