Audit a web page (performance, accessibility, etc.) with Lighthouse


Sample project used in this topic:

This topic covers how to collect performance metrics of Google web page using Lighthouse, then generate a report on its performance, accessibility and more. From there, the audits can be used as indicators for improving the web page.



  1. Open browser and navigate to Google web page.
  1. Get the current tab url as well as host and port of the current browser instance.
String url = WebUI.getUrl()
def (host, port) = CdpUtils.getServiceEndpoint()
  1. Audit the web page in a new tab with Lighthouse.
OsUtils.runCommand("lighthouse ${url} --hostname ${host} --port ${port} --no-enable-error-reporting", null, null)
  1. Finally, clean up and close the browser.
  1. An HTML file will be generated in the root of the project.

[NEW] Page Audit Using Katalon + CDP + Lighthouse