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.

[BUG] "Clicking the checkbox did not change its state" on rare occasions

See original GitHub issue

Context:

  • Playwright Version: @playwright/test 1.17.2
  • Operating System: Linux
  • Node.js version: 16.14
  • Browser: Chrome Headless
  • Extra: Run in Bitbucket Pipelines

Code Snippet

Trying to check a checkbox with following code:

await this.page!.check(`data-test-id=iAcceptUsageOfMyData`);

will result in about 1/20 of executions to this error:

Clicking the checkbox did not change its state.

Describe the bug

The checkbox has no logic to be disabled or anything. Also, according to the Playwright trace it is perfectly visible (I would like to avoid the “force” flag if possible). Still, on about 1/10 or 1/20 executions, the test fails with the mentioned error.

The website has a sticky header at the top. Not sure if this might have any influence on the issue.

You can find a trace of a failed run here:

Alles-2022-04-11-12-05-18-trace.zip

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
MiladSadinamcommented, Apr 25, 2022

I just saw that basically any input action (e.g. also await page.click()) can have the same problem. Do you have any generic advice how to solve the problem without using everywhere {force: true}?

You suggested to “wait until form stops changing”. How would you do this in a framework like vue.js or Angular?

0reactions
whyisusernamealwaystakencommented, May 2, 2022

Just had this issue in webkit tests with styled radio groups. Webkit trace for the radio check shows consistently off-target clicks. Our current workaround is having await page.click("text=the text on it") instead of await page.check("input[name=its name]", {force: true}) Firefox and Chrome tests were working using page.check-method tho

Read more comments on GitHub >

github_iconTop Results From Across the Web

Checkbox doesn't change its check-state when clicking on it
Given the problem its likely a CSS/Styling issue. I think some element is floating over the checkbox and preventing it from being clicked...
Read more >
NVDA's handling of checkboxes especially in Google ...
Hello NVDA community! Why does NVDA not read some checkboxes in Google Chrome? NVDA reads a lot of them, but some sites have...
Read more >
The most satisfying checkbox
The most satisfying checkbox for me has at most four frames of animation: checked, unchecked, clicked on and will toggle upon release, and...
Read more >
411065 - Checkbox not changing when label is clicked
Hi, FWIW, this problem can be bypassed by using the CSS property -webkit-user-select:none, so it appears to be related to text selection.
Read more >
Photos Can Help Diagnose Children's Eye Problems and ...
The red eye effect in photos, also known as the red reflex, can reveal surprising insights about children's eyes. The reflection of the...
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