java.lang.Object
co.verisoft.fw.selenium.junit.extensions.devtoolsExtension.DevtoolsBase
Direct Known Subclasses:
Console, Network

public abstract class DevtoolsBase extends Object
Base class for DevTools extensions in Selenium, responsible for managing report files and handling files related to JUnit tests.
  • Constructor Details

    • DevtoolsBase

      public DevtoolsBase()
  • Method Details

    • getExtensionAnnotation

      protected DevtoolsExtension getExtensionAnnotation(org.junit.jupiter.api.extension.ExtensionContext context)
      Retrieves the DevtoolsExtension annotation from the test context.
      Parameters:
      context - the test context
      Returns:
      the DevtoolsExtension annotation if present, otherwise null
    • storeNamePerThreadAndSupportMultipleDriverForNetwork

      protected String storeNamePerThreadAndSupportMultipleDriverForNetwork(org.openqa.selenium.WebDriver driver)
      Generates a unique name for each thread along with browser information, to support multiple drivers running simultaneously.
      Parameters:
      driver - the WebDriver instance
      Returns:
      a unique name string
    • createFileWriter

      protected FileWriter createFileWriter(File file) throws IOException
      Creates a FileWriter for the given file.
      Parameters:
      file - the file to write to
      Returns:
      the FileWriter instance
      Throws:
      IOException - if an error occurs while creating the writer
    • closeFileWriter

      protected void closeFileWriter(FileWriter fileWriter) throws IOException
      Closes the FileWriter after writing is complete.
      Parameters:
      fileWriter - the FileWriter to close
      Throws:
      IOException - if an error occurs while closing the writer