Package com.microsoft.playwright.impl
Class TracingImpl
java.lang.Object
com.microsoft.playwright.impl.LoggingSupport
com.microsoft.playwright.impl.ChannelOwner
com.microsoft.playwright.impl.TracingImpl
- All Implemented Interfaces:
Tracing
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.microsoft.playwright.Tracing
Tracing.StartChunkOptions, Tracing.StartOptions, Tracing.StopChunkOptions, Tracing.StopOptions -
Field Summary
FieldsFields inherited from class com.microsoft.playwright.impl.ChannelOwner
connection, guid, initializer, type -
Constructor Summary
ConstructorsConstructorDescriptionTracingImpl(ChannelOwner parent, String type, String guid, com.google.gson.JsonObject initializer) -
Method Summary
Modifier and TypeMethodDescription(package private) voidsetTracesDir(Path tracesDir) voidstart(Tracing.StartOptions options) Start tracing.voidstartChunk(Tracing.StartChunkOptions options) Start a new trace chunk.private voidstartCollectingStacks(String traceName) voidstop(Tracing.StopOptions options) Stop tracing.voidstopChunk(Tracing.StopChunkOptions options) Stop the trace chunk.private voidstopChunkImpl(Path path) private voidtracingStartChunk(String name, String title) Methods inherited from class com.microsoft.playwright.impl.ChannelOwner
adopt, disposeChannelOwner, handleEvent, runUntil, sendMessage, sendMessage, sendMessageAsync, toProtocolRef, withLogging, withWaitLoggingMethods inherited from class com.microsoft.playwright.impl.LoggingSupport
logApi, logApiIfEnabled, logWithTimestamp, withLoggingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.microsoft.playwright.Tracing
start, startChunk, stop, stopChunk
-
Field Details
-
includeSources
private boolean includeSources -
tracesDir
-
isTracing
private boolean isTracing -
stacksId
-
-
Constructor Details
-
TracingImpl
TracingImpl(ChannelOwner parent, String type, String guid, com.google.gson.JsonObject initializer)
-
-
Method Details
-
stopChunkImpl
-
startChunk
Description copied from interface:TracingStart a new trace chunk. If you'd like to record multiple traces on the sameBrowserContext, useTracing.start()once, and then create multiple trace chunks withTracing.startChunk()andTracing.stopChunk().**Usage**
context.tracing().start(new Tracing.StartOptions() .setScreenshots(true) .setSnapshots(true)); Page page = context.newPage(); page.navigate("https://playwright.dev"); context.tracing().startChunk(); page.getByText("Get Started").click(); // Everything between startChunk and stopChunk will be recorded in the trace. context.tracing().stopChunk(new Tracing.StopChunkOptions() .setPath(Paths.get("trace1.zip"))); context.tracing().startChunk(); page.navigate("http://example.com"); // Save a second trace file with different actions. context.tracing().stopChunk(new Tracing.StopChunkOptions() .setPath(Paths.get("trace2.zip")));- Specified by:
startChunkin interfaceTracing
-
tracingStartChunk
-
startCollectingStacks
-
start
Description copied from interface:TracingStart tracing.**Usage**
context.tracing().start(new Tracing.StartOptions() .setScreenshots(true) .setSnapshots(true)); Page page = context.newPage(); page.navigate("https://playwright.dev"); context.tracing().stop(new Tracing.StopOptions() .setPath(Paths.get("trace.zip"))); -
stop
Description copied from interface:TracingStop tracing. -
stopChunk
Description copied from interface:TracingStop the trace chunk. SeeTracing.startChunk()for more details about multiple trace chunks. -
setTracesDir
-