Rayrun
← Back to Discord Forum

Button not clicking issue

I'm using a locator to get a button and run the .click() command on it. This button isn't getting clicked, even though using the UI it shows the pointer hovering over it, and clicking the button through codegen shows the expected steps, and does get the button to actually be clicked.

Is this a common/uncommon issue in playwright, or is it a non issues from playwright's side? Any ideas what could be happening?

This thread is trying to answer question "Is this a common/uncommon issue in playwright, or is it a non-issue from playwright's side? Any ideas what could be happening?"

4 replies
Linhtinh603
Linhtinh603

Playwright may clicked on that element (as you described the pointer hover on this), but no event happen. Maybe you need to check JS event coding of that element or debug to ensure Playwright clicked that element or not yet clicked. If exactly Playwright did not work with that element, please show your code for more info.

whatever_1
whatever_1

Try out different locators for that button

whatever_1
whatever_1

use page.pause() to see how your test goes

Maybe Playwright is clicking on the button before the click event handler is attached to it.

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].