ElSnoMan/pyleniumio

Enable browser logging to get console.log

Closed this issue · 2 comments

Discussed in #238

Originally posted by szabolcslevay March 28, 2022
How can I set up the below capability/option in pylenium.json?

# enable browser logging
d = DesiredCapabilities.CHROME
d['goog:loggingPrefs'] = { 'performance':'ALL' }
driver = webdriver.Chrome(desired_capabilities=d)

or even better, as ChromeOptions

options = webdriver.ChromeOptions()
options.set_capability("goog:loggingPrefs", {"performance": "ALL"})
driver = webdriver.Chrome(options=options)
```</div>

Paraphrased answer from Discussion:

DesiredCapabilities are deprecated, but it seems we did not add the replacement with options. In the end, you would only need to update the dictionary via the CLI or pylenium.json.

For example:

{
  "driver": {
    "browser": "chrome",
    "remote_url": "",
    "wait_time": 10,
    "page_load_wait_time": 0,
    "options": [],
    "capabilities": {
      "goog:loggingPrefs": { "performance": "ALL" }
    },
    ...
}

Changes released in v1.14.3