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.

Cy.click failed because the targetted element is disabled

See original GitHub issue

cy.click failed with the reason - “The targetted element is disabled”. But the targetted element is enabled here. The outerhtml of the targetted element is as below.

sometimes cy.click failed with the reason that targetted element is not fully visible. I.e if the button or anchor ag text is partially visible at that click fails

<a class="btn" data-click="myClickEvent" data-bind="enable: enabled, css: { 'disabled': !enabled() }, attr:{'test-id':text}" test-id="elementDataTestID">...</a>

image

I debug and found that “ensureNotDisabled” is getting callled and After evaluating subject.prop(‘disabled’) it returns true which throws that error. Is any work around for this Except force:true. IT works but doesn’t wish to use…

Versions

Cypress Version : 5.1. OS:- Windows 10 Browser:- Electron and Chrome

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

2reactions
sainthkhcommented, Feb 17, 2021

Closing because of inactivity. If the problem is still happening, please open a new issue with a reproducible example.

0reactions
tirithencommented, Apr 22, 2022

I get the same error when trying to use .select() instead of .click(), in every way that I can verify the <select> tag, it is not disabled. It looks like a bug, but I’m not sure how to reproduce outside of the larger project I’m working with.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cy.click failed because the targetted element is disabled or its ...
I debug and found that "ensureNotDisabled" is getting callled and After evaluating subject. prop('disabled') it returns true which throws that  ...
Read more >
cy.type() failed because it targeted a disabled element
Cypress is failing a test because it claims that an element is disabled. However, there is nothing to indicate that this element is...
Read more >
Cy.Click Failed Because The Targetted Element Is Disabled ...
This disabled error happens consistently when the cypress test tries to enter information into an input field after directly unfocusing from an. I'm ......
Read more >
cypress-io/cypress - Gitter
Struggling with disabled element: I get this error: CypressError: cy.type() failed because it targeted a disabled element. The element typed into was: >...
Read more >
Actions | Cypress examples (v7.1.0) - Gleb Bahmutov
Click on canvas · Click on multiple elements · Click on disabled element · Click waits for visible element · Get checked option....
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