Class CaptureNetworkRequests
java.lang.Object
net.serenitybdd.screenplay.playwright.interactions.CaptureNetworkRequests
- All Implemented Interfaces:
net.serenitybdd.core.SkipNested,net.serenitybdd.screenplay.Performable
public class CaptureNetworkRequests
extends Object
implements net.serenitybdd.screenplay.Performable
Start capturing network requests and responses for later analysis.
This interaction captures all network traffic including:
- Request URL, method, and headers
- Response status code and body
- Failed requests (network errors, timeouts)
Sample usage:
// Start capturing network requests
actor.attemptsTo(CaptureNetworkRequests.duringTest());
// ... perform actions ...
// Query captured requests
List<CapturedRequest> requests = actor.asksFor(NetworkRequests.all());
List<CapturedRequest> failed = actor.asksFor(NetworkRequests.failed());
// Clear captured requests
actor.attemptsTo(CaptureNetworkRequests.clear());
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a captured network request with its response. -
Method Summary
Modifier and TypeMethodDescriptionstatic CaptureNetworkRequestsclear()Clear all previously captured network requests.static CaptureNetworkRequestsStart capturing network requests during the test.static StringGet the key used to store network requests in actor's memory.<T extends net.serenitybdd.screenplay.Actor>
voidperformAs(T actor) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.serenitybdd.screenplay.Performable
then
-
Method Details
-
duringTest
Start capturing network requests during the test. -
clear
Clear all previously captured network requests. -
performAs
public <T extends net.serenitybdd.screenplay.Actor> void performAs(T actor) - Specified by:
performAsin interfacenet.serenitybdd.screenplay.Performable
-
getNetworkRequestsKey
Get the key used to store network requests in actor's memory.
-