Rayrun
โ† Back to Discord Forum

JavaScript error only in Playwright Chromium

johannes.przymusinskiposted in #help-playwright
Open in Discord
johannes.przymusinski
johannes.przymusinski

Hey ๐Ÿ‘‹

I've stumbled across a rather strange issue. I'm currently writing tests for the cookie consent on my website. During that, I noticed that I'm getting a JavaScript error in the Playwright Chromium when the consent should be triggered, which does not appear in various Chrome / Chromium browsers on different devices. It also works fine in Playwright with Firefox.

The error is a

TypeError: undefined is not an object (evaluating 'v.removeAttribute')

The major versions of the Chrome browsers (incl. Playwright) matched (117), so there shouldn't be that big of a difference in them. I can also reproduce this on multiple deployments of my site, so it doesn't seem to be an issue with my local setup or anything.

What would be the best way to debug this? Have you ever had any similar issues? I'm not sure if it is okay to share the link to my production website where this can be reproduced or not. Hence, I'm not currently, but when this is ok to share, I can share the link and an example from playwright codegen to reproduce this.

TL;DR: I'm getting a JavaScript error on my site, only in the Playwright Chromium browser.

This thread is trying to answer question "What would be the best way to debug a JavaScript error that only appears in the Playwright Chromium browser?"

1 reply

The best way to debug this could be to visit your site using the browsers installed by Playwright, or to add an await page.pause() early in the test, then proceed through the code/steps of your test and page

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].