Class SoftAssertsScreenShot

java.lang.Object
co.verisoft.fw.asserts.SoftAsserts
co.verisoft.fw.asserts.SoftAssertsScreenShot

public class SoftAssertsScreenShot extends co.verisoft.fw.asserts.SoftAsserts
This class extends the SoftAsserts class and provides functionality to capture screenshots when assertions fail. It is responsible for saving screenshots in a specified folder and attaching them to the report.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    SoftAssertsScreenShot(VerisoftDriver driver, boolean isMultipleScreenShots)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Handles assertion failures by capturing a screenshot and attaching it to the report.
    void
    Captures a screenshot and attaches it to the report.

    Methods inherited from class co.verisoft.fw.asserts.SoftAsserts

    assertAll, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertArrayEquals, assertDoesNotThrow, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertNotEquals, assertNotNull, assertNotSame, assertNull, assertSame, assertTrue, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SoftAssertsScreenShot

      public SoftAssertsScreenShot(VerisoftDriver driver)
    • SoftAssertsScreenShot

      public SoftAssertsScreenShot(VerisoftDriver driver, boolean isMultipleScreenShots)
  • Method Details

    • takeScreenshotAndAttachedToReport

      public void takeScreenshotAndAttachedToReport()
      Captures a screenshot and attaches it to the report. This method takes a screenshot using the provided driver, saves it in the designated folder with a unique name based on the current date and time, and attaches it to the report. If an error occurs during the process, an error message is logged to the report.
    • handleFailure

      protected void handleFailure(String message, AssertionError e)
      Handles assertion failures by capturing a screenshot and attaching it to the report.
      Overrides:
      handleFailure in class co.verisoft.fw.asserts.SoftAsserts
      Parameters:
      message - The message to include with the screenshot in the report.
      e - The AssertionError that occurred.