How to get “console.log” from Selenium (with Chrome) in the Rails log files?

前端 未结 1 465
一向
一向 2021-01-28 12:31

In Rails project, I\'m using Cucumber, with Capybara, in order to run my tests in a Chrome web browser through Selenium.

My tests are running fine but I would like to ge

相关标签:
1条回答
  • 2021-01-28 13:01

    The logs don't show up automatically, you would need to request them from Selenium and then add then write them out to whatever log you like. To request the logs you need to do something like

    page.driver.browser.manage.logs.get(:browser) # :driver, etc.
    

    Generally you'd do something like that in an after step and then write it to the log file you want it to be in.

    0 讨论(0)
提交回复
热议问题