robotframework-browser icon indicating copy to clipboard operation
robotframework-browser copied to clipboard

Add Capture Console Messages keyword

Open dgalezow opened this issue 4 years ago • 3 comments

It would be great if we could gather logs from browser console for easier debugging of test fails

From slack by René

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

dgalezow avatar Apr 05 '22 08:04 dgalezow

@allcontributors please add @dgalezow for ideas.

aaltat avatar Apr 05 '22 08:04 aaltat

@aaltat

I've put up a pull request to add @dgalezow! :tada:

allcontributors[bot] avatar Apr 05 '22 08:04 allcontributors[bot]

Removing priority high as this is already available in Close Page

mkorpela avatar Sep 18 '22 15:09 mkorpela

Closing this on favor of #2176

aaltat avatar Jan 28 '23 20:01 aaltat