Hi again,
I’m trying to capture everything that is logged into console. I can save HAR file and parse network and get request/response/statuscode … but I need get output of console into file, or into variable, or to any point
I tried to do something like:
async function captureLogs(page, logger) {
logger("Did I run?")
page.on("console", (message) => {
logger(message.text())
})
}
exports.__esModule = true;
exports.captureLogs = captureLogs;
But this function just run (it is custom keyword), and does nothing else. (its js module) … Is there any way how to run this on background and listen on all events that happen? I run this keyword after the ‘New Page’ keyword is run.
I need information from console like:
Service worker registration complete
getting from server user
[Violation] ‘setTimeout’ handler took 228ms
etc… lot of information that are shown only in console, so the HAR file does not contains them.
Is there any way how to achieve this?