Class Network
java.lang.Object
co.verisoft.fw.selenium.junit.extensions.networkExtension.Network
Deprecated.
Utility class for handling network requests and responses in Selenium.
Provides methods to retrieve the last, multiple, or all requests and responses
for a given WebDriver instance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<org.openqa.selenium.devtools.v85.network.model.Request>
getAllRequests
(VerisoftDriver driver) Deprecated.Retrieves all network requests recorded for the given driver.static List<org.openqa.selenium.devtools.v85.network.model.ResponseReceived>
getAllResponses
(VerisoftDriver driver) Deprecated.Retrieves all network responses recorded for the given driver.static org.openqa.selenium.devtools.v85.network.model.Request
getLastRequest
(VerisoftDriver driver) Deprecated.Retrieves the most recent network request recorded for the given driver.static org.openqa.selenium.devtools.v85.network.model.ResponseReceived
getLastResponse
(VerisoftDriver driver) Deprecated.Retrieves the most recent network response recorded for the given driver.static org.openqa.selenium.devtools.v85.network.model.ResponseReceived
getLastResponseByName
(VerisoftDriver driver, String name) Deprecated.Attempts to retrieve the last response for a given service name within 10 seconds.static List<org.openqa.selenium.devtools.v85.network.model.Request>
getNumOfLastRequests
(VerisoftDriver driver, int numOfRecentCalls) Deprecated.Retrieves the last 'num' network requests recorded for the given driver.static List<org.openqa.selenium.devtools.v85.network.model.ResponseReceived>
getNumOfLastResponses
(VerisoftDriver driver, int numOfRecentCalls) Deprecated.Retrieves the last 'num' network responses recorded for the given driver.static String
getResponseBody
(VerisoftDriver driver, String serviceName) Deprecated.Retrieves the body of the response for a specific service name from the network.static String
storeNamePerThreadAndSupportMultipleDriverForNetwork
(org.openqa.selenium.WebDriver driver) Deprecated.Generates a unique store name for the current thread, ensuring support for multiple drivers.
-
Constructor Details
-
Network
public Network()Deprecated.
-
-
Method Details
-
getResponseBody
Deprecated.Retrieves the body of the response for a specific service name from the network.- Parameters:
driver
- The VerisoftDriver instance to interact with the network.serviceName
- The name of the service whose response body is to be retrieved.- Returns:
- The body of the response as a String.
-
getLastResponseByName
public static org.openqa.selenium.devtools.v85.network.model.ResponseReceived getLastResponseByName(VerisoftDriver driver, String name) Deprecated.Attempts to retrieve the last response for a given service name within 10 seconds. The function checks if the list of responses is not changing in size. If the size remains constant, it fetches the response for the given name.- Parameters:
driver
- The VerisoftDriver instance used for fetching network responses.name
- The name of the service or URL part to search for in the response.- Returns:
- The ResponseReceived instance corresponding to the service name, or null if not found within the timeout.
-
getLastResponse
public static org.openqa.selenium.devtools.v85.network.model.ResponseReceived getLastResponse(VerisoftDriver driver) Deprecated.Retrieves the most recent network response recorded for the given driver.- Parameters:
driver
- the VerisoftDriver instance- Returns:
- the latest Response object
-
getLastRequest
public static org.openqa.selenium.devtools.v85.network.model.Request getLastRequest(VerisoftDriver driver) Deprecated.Retrieves the most recent network request recorded for the given driver.- Parameters:
driver
- the VerisoftDriver instance- Returns:
- the latest Request object
-
getAllResponses
public static List<org.openqa.selenium.devtools.v85.network.model.ResponseReceived> getAllResponses(VerisoftDriver driver) Deprecated.Retrieves all network responses recorded for the given driver.- Parameters:
driver
- the VerisoftDriver instance- Returns:
- a list of all Response objects
-
getAllRequests
public static List<org.openqa.selenium.devtools.v85.network.model.Request> getAllRequests(VerisoftDriver driver) Deprecated.Retrieves all network requests recorded for the given driver.- Parameters:
driver
- the VerisoftDriver instance- Returns:
- a list of all Request objects
-
getNumOfLastResponses
public static List<org.openqa.selenium.devtools.v85.network.model.ResponseReceived> getNumOfLastResponses(VerisoftDriver driver, int numOfRecentCalls) Deprecated.Retrieves the last 'num' network responses recorded for the given driver.- Parameters:
driver
- the VerisoftDriver instancenumOfRecentCalls
- the number of responses to retrieve- Returns:
- a list of the last 'num' Response objects
-
getNumOfLastRequests
public static List<org.openqa.selenium.devtools.v85.network.model.Request> getNumOfLastRequests(VerisoftDriver driver, int numOfRecentCalls) Deprecated.Retrieves the last 'num' network requests recorded for the given driver.- Parameters:
driver
- the VerisoftDriver instancenumOfRecentCalls
- the number of requests to retrieve- Returns:
- a list of the last 'num' Request objects
-
storeNamePerThreadAndSupportMultipleDriverForNetwork
public static String storeNamePerThreadAndSupportMultipleDriverForNetwork(org.openqa.selenium.WebDriver driver) Deprecated.Generates a unique store name for the current thread, ensuring support for multiple drivers. Extracts the driver name from its string representation and appends it to the thread ID.- Parameters:
driver
- the WebDriver instance- Returns:
- a unique store name for network data
-