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.

visibilityOf/presenceOf/etc. gives wrong result for disabled inputs

See original GitHub issue

Bug report

  • Node Version: 10.9.0
  • Protractor Version: 6.0.0
  • Angular Version: 7.2.10
  • Browser(s): Chrome
  • Operating System and Version Window 10

When using expected conditions on a disabled input the following EC:s gives you false even though the element is really there (verified visually): presenceOf visibilityOf elementToBeClickable

Also textToBePresentInElementValue doesn’t match even though it should

Same code worked fine before upgrading.

Steps to reproduce:

  1. Add a disabled input to any page you’re testing
<input class="field" value="test" disabled />
  1. Add an expected condition
await browser.wait(ExpectedConditions.visibilityOf(element(by.css('.field'))), 30000);
  1. No Profit. Will fail even though element is visible.

Edit: I might add that textToBePresentInElementValue doens’t work, but element.getAttribute(‘value’) does. So it doesn’t seem related to getting the actual value.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:7
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
JonWallstencommented, Apr 2, 2019

@cnishina: Would you mind take a look at this?

0reactions
xiuzhen1103commented, Dec 11, 2020

I found root cause was test failed due to failed test when running multiple instance causing selector not found and second instance not opening the page

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disabled form inputs do not appear in the request
To answer my own question: No, readony only works for <input/> form control of type='text' and type='password' and for <textarea/>. What readonly does...
Read more >
Input Disabled HTML Attribute Explained For Inexperienced ...
If a field is disabled , the value of the field is not sent to the server when the form is submitted. If...
Read more >
HTML attribute: disabled - HTML: HyperText Markup Language
The Boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form.
Read more >
Disabled input considered as invalid in dynamic form #11432
the problem I always get valid: false so I thing that if the field is disabled, the valid flag should be true to...
Read more >
Exploring the difference between disabling a form control ...
Sometimes users must be prevented from interacting with a form based on their role in an application; an input field can also be...
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