Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

is_displyed() returns True, even if the element is not visible to the user #5499

Closed
lukeis opened this issue Mar 4, 2016 · 7 comments
Closed

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 5499


Selenium version: 2.32.0
OS: Windows,Mac,Ubuntu
Browser: Firefox
Browser version: 19, 20

The attached html file has 2 li elements:
-the first li is hidden, with a padding of 1px
-the second li does not have any css properties

When is use is_displayed on the .body element of the first li, it returns True, although
it should return False

Here is the the reduced test for the html file:

from selenium import webdriver
from selenium.webdriver.common.by import By  
from unittestzero import Assert

def test_element_displayed():
    driver = webdriver.Firefox()

    driver.get('file://<path>/test.html')

    test_element = driver.find_element(By.CSS_SELECTOR, '#review-414267 .body')
    Assert.false(test_element.is_displayed())

The output of this test is: http://pastebin.mozilla.org/2307727

Reported by trifandreialin on 2013-04-15 13:03:50


- _Attachment: [test.html](https://storage.googleapis.com/google-code-attachments/selenium/issue-5499/comment-0/test.html)_
@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by david.burns@theautomatedtester.co.uk on 2013-04-15 13:12:24

  • Labels added: Browser-Atoms
  • Labels removed: Status-Untriaged

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I've run this on Fx18 (Ubuntu) and it passes.

Reported by campbell.zac on 2013-04-15 14:37:43

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by barancev on 2013-04-16 07:36:49

  • Labels added: Browser-Firefox

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by david.burns@theautomatedtester.co.uk on 2013-04-17 14:28:24

  • Status changed: Accepted

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

I don't know what happened with the first case, but test2.html should reveal the is_displayed()
issue.

Reported by trifandreialin on 2013-04-17 15:28:46


- _Attachment: [test2.html](https://storage.googleapis.com/google-code-attachments/selenium/issue-5499/comment-5/test2.html)_

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Fixed in the HEAD, see revision acd6409b6740 and revision e923c1389b85

Reported by barancev on 2013-04-24 17:34:36

  • Status changed: Fixed

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 18:17:08

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 4, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant