visibilityOf/presenceOf/etc. gives wrong result for disabled inputs
See original GitHub issueBug 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:
- Add a disabled input to any page you’re testing
<input class="field" value="test" disabled />
- Add an expected condition
await browser.wait(ExpectedConditions.visibilityOf(element(by.css('.field'))), 30000);
- 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:
- Created 4 years ago
- Reactions:7
- Comments:7 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@cnishina: Would you mind take a look at this?
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