class Playwright::ConsoleMessage

“‘
.json_value() # 42<br>msg.args.json_value() # hello
# Deconstruct print arguments
msg = msg_info.value
page.evaluate(“console.log(’hello’, 42, { foo: ‘bar’ })”)
# Issue console.log inside the page
with page.expect_console_message() as msg_info:
# Get the next console log
page.on(“console”, lambda msg: print(f“error: {msg.text}”) if msg.type == “error” else None)
# Listen for all console events and handle errors
page.on(“console”, lambda msg: print(msg.text))
# Listen for all console logs
“‘python sync
context.
For each console messages logged in the page there will be corresponding event in the Playwright
`ConsoleMessage` objects are dispatched by page via the [`event: Page.console`] event.

def args

List of arguments passed to a `console` function call. See also [`event: Page.console`].
def args
  wrap_impl(@impl.args)
end

def location

def location
  wrap_impl(@impl.location)
end

def page

The page that produced this console message, if any.
def page
  wrap_impl(@impl.page)
end

def text

The text of the console message.
def text
  wrap_impl(@impl.text)
end

def type

`'count'`, `'timeEnd'`.
`'trace'`, `'clear'`, `'startGroup'`, `'startGroupCollapsed'`, `'endGroup'`, `'assert'`, `'profile'`, `'profileEnd'`,
One of the following values: `'log'`, `'debug'`, `'info'`, `'error'`, `'warning'`, `'dir'`, `'dirxml'`, `'table'`,
def type
  wrap_impl(@impl.type)
end