79110437

Date: 2024-10-21 14:16:34
Score: 2
Natty:
Report link

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

Reasons:
  • Blacklisted phrase (1): enter image description here
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Starts with a question (0.5): When I
  • Low reputation (1):
Posted by: Panek Adamek