If you are weighing up which tool to use for test automation have a look at Playwrights Trace Viewer, it may persuade you to use Playwright

When we are automating and maintaining tests we need good feedback on test runs. Playwright gives quick and useful feedback in its Trace Viewer which provides feedback on the run of tests. Trace Viewer’s feedback is one reason I like automating tests with Playwright. Through Trace Viewer you can:

  • View the UI of the application under test at each step and before and after each step:
  • See on the UI where the mouse has clicked:
  • See the UI of the application under test over time:
  • Read the content of the network and console tabs from dev tools as they were at any point in the test run:
  • See how long each step in the test takes:
  • See the source code of the test that is executed at each step:
  • If a test fails I can read an error message that includes the name of the file and line number where the test failed:
  • Get metadata about your test:
  • Find the built-in locator for an element in the UI, I could not find this feature in the documentation. To find the built-in-locator for an element:
    • click on the circles next to Locator
    • click on the UI element in the screenshot that you would like to know the built-in-locator for
    • then the built-in locator will be displayed in the Locator tab:

If a Playwright test fails, Trace Viewer can help you:

  • see a screenshot of where the test failed
  • investigate the UI of the application under test at the point it failed and use the browser’s dev tools to investigate the failure
  • see the lines of test code in the test where the failure occurred
  • because you can share the URL from CI of the Trace View 

Trace Viewer can help you develop new tests because

  •  run locally by adding an option to the command line
  • it can show you the built-in locator for an element 
  • if a test fails it shows you where in the test it failed

I have automated tests with several tools and never found a feature as helpful as Playwright Trace Viewer. I will also likely find more ways that Trace Viewer provides valuable feedback over time. If you are considering automating tests with Playwright I would recommend investigating Playwright’s Trace Viewer because it may be the factor which persuades you to use Playwright!

Published by Mike Harris

Mike has been working in testing for 20 years and is the lone tester for Geckoboard. He has been a Test Lead and has also worked as a part of waterfall, lean and agile teams. He has a B.Sc.(HONS) from Middlesex University and is an Associate of the University of Hertfordshire. He has set up and led a Testing Community of Practice and been part of a successful agile transition. He is Vice-Chair of the British Computer Society’s Specialist Interest Group in Software Testing. He also contributed to the e-books Testing Stories and How Can I test This? and has had articles published by the Ministry of Testing, LambdaTest and The QA Lead.

Leave a comment

Design a site like this with WordPress.com
Get started