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
class TracingImpl extends ChannelOwner implements Tracing
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.microsoft.playwright.Tracing
Tracing.StartChunkOptions, Tracing.StartOptions, Tracing.StopChunkOptions, Tracing.StopOptions
-
-
Field Summary
Fields Modifier and Type Field Description private booleanincludeSourcesprivate booleanisTracingprivate java.lang.StringstacksIdprivate java.nio.file.PathtracesDir-
Fields inherited from class com.microsoft.playwright.impl.ChannelOwner
connection, guid, initializer, type
-
-
Constructor Summary
Constructors Constructor Description TracingImpl(ChannelOwner parent, java.lang.String type, java.lang.String guid, com.google.gson.JsonObject initializer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidsetTracesDir(java.nio.file.Path tracesDir)voidstart(Tracing.StartOptions options)Start tracing.voidstartChunk(Tracing.StartChunkOptions options)Start a new trace chunk.private voidstartCollectingStacks(java.lang.String traceName)voidstop(Tracing.StopOptions options)Stop tracing.voidstopChunk(Tracing.StopChunkOptions options)Stop the trace chunk.private voidstopChunkImpl(java.nio.file.Path path)private voidtracingStartChunk(java.lang.String name, java.lang.String title)-
Methods inherited from class com.microsoft.playwright.impl.ChannelOwner
adopt, disposeChannelOwner, handleEvent, runUntil, sendMessage, sendMessage, sendMessageAsync, toProtocolRef, withLogging, withWaitLogging
-
Methods inherited from class com.microsoft.playwright.impl.LoggingSupport
logApi, logApiIfEnabled, logWithTimestamp, withLogging
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.microsoft.playwright.Tracing
start, startChunk, stop, stopChunk
-
-
-
-
Constructor Detail
-
TracingImpl
TracingImpl(ChannelOwner parent, java.lang.String type, java.lang.String guid, com.google.gson.JsonObject initializer)
-
-
Method Detail
-
stopChunkImpl
private void stopChunkImpl(java.nio.file.Path path)
-
startChunk
public void startChunk(Tracing.StartChunkOptions options)
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
private void tracingStartChunk(java.lang.String name, java.lang.String title)
-
startCollectingStacks
private void startCollectingStacks(java.lang.String traceName)
-
start
public void start(Tracing.StartOptions options)
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
public void stop(Tracing.StopOptions options)
Description copied from interface:TracingStop tracing.
-
stopChunk
public void stopChunk(Tracing.StopChunkOptions options)
Description copied from interface:TracingStop the trace chunk. SeeTracing.startChunk()for more details about multiple trace chunks.
-
setTracesDir
void setTracesDir(java.nio.file.Path tracesDir)
-
-