How to print browser console logs using Cucumber Ruby Automation?

Can you help with printing console logs in a web browser for any errors in Cucumber Capybara Test Automation? I am using phantomJS webdriver as shown below:

Capybara :: Selenium :: Driver.new (application ,: browser =>: phantomjs, Desired qualities: {'phantomjs.cli.args' => ['--ignore-SSL error = yes']

I want to capture JS browser console logs and print it when I need to do automation

+4
source share
1 answer

Since you use selenium, you can try

page.driver.browser.manage.logs.get("browser")

. PhantomJS

+11

Source: https://habr.com/ru/post/1626229/


All Articles