Class TracingImpl

    • Field Detail

      • includeSources

        private boolean includeSources
      • tracesDir

        private java.nio.file.Path tracesDir
      • isTracing

        private boolean isTracing
      • stacksId

        private java.lang.String stacksId
    • 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: Tracing
        Start a new trace chunk. If you'd like to record multiple traces on the same BrowserContext, use Tracing.start() once, and then create multiple trace chunks with Tracing.startChunk() and Tracing.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:
        startChunk in interface Tracing
      • 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: Tracing
        Start 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")));
         
        Specified by:
        start in interface Tracing
      • setTracesDir

        void setTracesDir​(java.nio.file.Path tracesDir)