question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] Is locator.click() always click in the center of the button?

See original GitHub issue

I use playwright 1.19.2 at the moment

Is locator.click() always click in the center of the button? what if I have element overlayed element on top of the button (partially but still clickable manually). For example, chat bubble is covering a portion of the button. image

As you can see the button is visible (and clickable manually) but playwright saying that subtree intercept pointer event (due to overlayed chat bubble)

 locator.click: Timeout 60000ms exceeded.
    =========================== logs ===========================
    waiting for selector "#continue-contract"
      selector resolved to visible <button type="button" ng-click="continue()" id="continue…>…</button>
    attempting click action
      waiting for element to be visible, enabled and stable
      element is visible, enabled and stable
      scrolling into view if needed
      done scrolling
      performing click action
      <div class="intercom-lightweight-app-launcher-icon in…>…</div> from <div class="intercom-lightweight-app">…</div> subtree intercepts pointer events

Btw, below is the intercom bubble as I mentioned:

      <div class="intercom-lightweight-app-launcher-icon in…>…</div> from <div class="intercom-lightweight-app">…</div> subtree intercepts pointer events

As a note, I think we could reposition chat bubble. The problem is the actual button we want to click is having a dynamic position (but still clickable manually). So reposition chat bubble is not the preferred solution

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
pavelfeldmancommented, Jun 9, 2022

If you force, it’ll click the center and hit your overlay. Your scenario looks like an edge case that we would not want to address. you can do await locator.dispatchEvent('click') to just dispatch it in JS and move on.

0reactions
pavelfeldmancommented, Jun 10, 2022

Closing as per above, please feel free to open a new issue if this does not cover your use case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cypress does not always executes click on element
And from time to time Cypress is not able to execute click on button. The tests click on buttons (0 to 9 )...
Read more >
988 Frequently Asked Questions - SAMHSA
A trained crisis counselor answers the phone, listens to the caller, understands how their problem is affecting them, provides support, and shares resources...
Read more >
Triggering click event on Leaflet map? - GIS Stack Exchange
I'd like to open a popup at the clicked location and I don't want to add a marker or add a new popup...
Read more >
Use a command button to start an action or a series of actions
Click the location on the form where you want to place the command button. ... In a stacked layout, the label and the...
Read more >
Google Sheets cheat sheet
Drag the cells to a new location. Group rows or columns: Select the rows or columns. Click Data and then Group rows or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found