Class DevtoolsBase
java.lang.Object
co.verisoft.fw.selenium.junit.extensions.devtoolsExtension.DevtoolsBase
Base class for DevTools extensions in Selenium, responsible for managing report files
and handling files related to JUnit tests.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
closeFileWriter
(FileWriter fileWriter) Closes the FileWriter after writing is complete.protected FileWriter
createFileWriter
(File file) Creates a FileWriter for the given file.protected DevtoolsExtension
getExtensionAnnotation
(org.junit.jupiter.api.extension.ExtensionContext context) Retrieves the DevtoolsExtension annotation from the test context.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.
-
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
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
Closes the FileWriter after writing is complete.- Parameters:
fileWriter
- the FileWriter to close- Throws:
IOException
- if an error occurs while closing the writer
-