Closed amkisko closed 8 months ago
As for reference: https://github.com/dbalatero/capybara-chromedriver-logger, it also has raise_js_errors
feature which could be very useful.
The function is not provided by this capybara driver, however we can use https://playwright-ruby-client.vercel.app/docs/api/console_message for observing the console log output via page.
page.driver.with_playwright_page do |page|
page.on("console", ->(msg) {
if msg.type == 'error'
puts "error: #{msg.text}"
end
})
end
Could you try it?
Thank you, works perfect!
I tried it in different places, seems that the callback is correctly set only after visit
(probably when the page has been initialised), although page
instance and with_playwright_page
do not raise exceptions in the other places.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hey! I would like to get JavaScript output from browser side to ruby. Are there any possibilities to do so with this driver?