selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[🐛 Bug]: Can't capture full Object structures in console log

Open zerosdev opened this issue 9 months ago • 7 comments

What happened?

I'm trying to get the full log messages in console (Chrome) but the log captured is only "Object" when in real browser we can expand object structures. Is there any possibility to capture the full object values?

How can we reproduce the issue?

  1. Add logger to the webdriver instance to print log message in Terminal
const logs: logging.Entry[] = await driver.manage().logs().get(logging.Type.BROWSER);
console.log(logs);
  1. Create a webpage than print an object in the browser's console
<script>console.warn(JSON.parse(`{"key":"value"}`));</script>
  1. Navigate to that webpage

  2. Check terminal messages

Relevant log output

[WARNING] [2024-05-27T08:20:34.139Z] http://localhost:8000/console.html 6:16 Object

Operating System

MacOS X

Selenium version

Javascript 4.7.1

What are the browser(s) and version(s) where you see this issue?

Chrome 125

What are the browser driver(s) and version(s) where you see this issue?

Chromedriver 125

Are you using Selenium Grid?

No

zerosdev avatar May 27 '24 08:05 zerosdev