Add Capture Console Messages keyword
It would be great if we could gather logs from browser console for easier debugging of test fails
Quote internal idea:
we could collect all console messages, once a keyword like “Capture Console Messages” is called on a page. Then we collect an array of ConsoleMessage objects as dictionaries/json plain objects.
{ type: .., text: .., location: { url: .., lineNumber: .., columnNumber: .. } }
https://playwright.dev/docs/api/class-consolemessage
With Get Captured Console Messages we return the array, which has been collected by the event listener
The Get Captured Console Messages keyword could also have some kind of arguments to filter the messages. by time or amount
Like:
Get Captured Console Messages history=20 sec
or
Get Captured Console Messages last=30
@allcontributors please add @dgalezow for ideas.
Removing priority high as this is already available in Close Page
Closing this on favor of #2176