32. Deep Failure Analysis with Playwright Trace Viewer

Configuring Tracing in Python

# Start tracing before actions:
context.tracing.start(screenshots=True, snapshots=True, sources=True)

# Run test actions...

# Stop and save trace archive:
context.tracing.stop(path="traces/failure_trace.zip")

# View trace with CLI:
# playwright show-trace traces/failure_trace.zip

Task

  • Implement start_tracing_session(context):
  • 1. context.tracing.start(screenshots=True, snapshots=True)
πŸ’‘Common doubts
Did you like the problem?
Lesson 32 of 37
Python
Loading code editor…
Next