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

Created on 29 Mar 2019  路  7Comments  路  Source: angular/protractor

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.

Most helpful comment

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

All 7 comments

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

@kyliau @alan-agius4 : I noticed you guys have started to make commits in this repo! That's awesome. When we did a POC to try to move to Protractor 6 this is what stopped us. Please take a look whenever you have the chance and thanks for you contributions.

Hi @JonWallsten, protractor version 6, is deprecated.

Unless you are already on Protractor version 6 you shouldn鈥檛 try to use it.

@alan-agius4 I'm aware. We did this POC last year. But I doubt this bug has been fixed since. Hence the mention on you guys. I can try to recreate the behavior in 7.x.x and update the bug. If I recall correctly this was the major thing stopping us from proceed with the await/async upgrade. I tried to figure out myself what was happening, but got lost in the Protractor source code.

This is still an issue, I have experienced. It was working few weeks ago until I updated to latest protractor version 7.0.0

As far as I'm aware this issue was with 6 due to a alpha version of selenium driver used. Protractor 7 uses the same stable selenium driver as 5.x and appears to be mainly a code clean-up

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

Was this page helpful?
0 / 5 - 0 ratings