Playwright provides an useful inspector. https://playwright.dev/docs/inspector/
playwright.chromium.launch(headless: false) do |browser|
browser.new_context do |context|
# This method call should be put just after creating BrowserContext.
page = context.new_pagè
page.pause requires Playwright debug session, and it can be enabled by calling
BrowserContext#enable_debug_console! in advance.
Note that since Ruby is not officially supported in Playwright, many limitations exist. We CANNOT
- Launch inspector via
- Debug without inspector UI (
PWDEBUG=consoleis not working well)
- Show Ruby code in inspector