This repository has been archived by the owner. It is now read-only.

Element invisible without hovering is seen as visible by IEDriver #6827

Closed
lukeis opened this Issue Mar 4, 2016 · 5 comments

Comments

Projects
None yet
1 participant
@lukeis
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 6827

Selenium version: selenium-webdriver 2.37.0 (or similar)
OS: Windows
Browser: IE10 (at least)

My application has several links that are hidden until the user hovers over an element
in the page.  Firefox and Chrome correctly report that the element is not visible until
issuing the proper hover event, but IE10 always reports that the element is visible,
regardless of the hover state that controls the element's visibility.   The following
script demonstrates the problem: 

----
require 'rubygems'
require "selenium-webdriver"

test_page = "http://en.wikipedia.beta.wmflabs.org/wiki/Talk:Flow_QA"
browser = Selenium::WebDriver.for :firefox

browser.navigate.to test_page

puts "Talk link element visible is: "
puts browser.find_element(:css, "a[title='User talk:Selenium user']").displayed?
puts ""

if browser.find_element(:css, "a[title='User talk:Selenium user']").displayed? == false
  puts "Selenium thinks talk link is not visible. This is correct."
end

if browser.find_element(:css, "a[title='User talk:Selenium user']").displayed? == true
  puts "Selenium thinks Talk link is visible. This is not correct. Is this an IEDriver
bug?"
end

author_link = browser.find_element(:css, "a[title='User:Selenium user']")
browser.mouse.move_to(author_link)

puts ""
puts "Talk link element visible is: "
puts browser.find_element(:css, "a[title='User talk:Selenium user']").displayed?
puts ""

if browser.find_element(:css, "a[title='User talk:Selenium user']").displayed? == true
  puts "After hovering on Selenium user link, Selenium thinks Talk link is visible.
This is correct."
end
----

Note that the application the script points to is under active development.  It should
be generally available, but my apologies in advance if for some reason the site happens
to  be down or the application in an undesirable state. 

Reported by cmcmahon@wikimedia.org on 2014-01-10 16:10:41

@lukeis

This comment has been minimized.

Show comment
Hide comment
@lukeis

lukeis Mar 4, 2016

Member
The issue here is that the element is made "invisible" on the page by setting its opacity
to 0. The IE driver, at the moment, explicitly ignores opacity in determining element
visibility. Changing it to not ignore opacity is a simple one-line change in Element.cpp,
but I don't have any sense of what the effects will be for downlevel browsers that
don't understand opacity.

Reported by james.h.evans.jr on 2014-01-10 17:30:51

  • Status changed: Accepted
  • Labels removed: Status-Untriaged
Member

lukeis commented Mar 4, 2016

The issue here is that the element is made "invisible" on the page by setting its opacity
to 0. The IE driver, at the moment, explicitly ignores opacity in determining element
visibility. Changing it to not ignore opacity is a simple one-line change in Element.cpp,
but I don't have any sense of what the effects will be for downlevel browsers that
don't understand opacity.

Reported by james.h.evans.jr on 2014-01-10 17:30:51

  • Status changed: Accepted
  • Labels removed: Status-Untriaged
@lukeis

This comment has been minimized.

Show comment
Hide comment
@lukeis

lukeis Mar 4, 2016

Member

Reported by barancev on 2014-01-10 19:31:49

  • Labels added: Browser-IE
Member

lukeis commented Mar 4, 2016

Reported by barancev on 2014-01-10 19:31:49

  • Labels added: Browser-IE
@lukeis

This comment has been minimized.

Show comment
Hide comment
@lukeis

lukeis Mar 4, 2016

Member
This issue was closed by revision bdc0a98f97e3.

Reported by james.h.evans.jr on 2014-01-10 21:25:09

  • Status changed: Fixed
Member

lukeis commented Mar 4, 2016

This issue was closed by revision bdc0a98f97e3.

Reported by james.h.evans.jr on 2014-01-10 21:25:09

  • Status changed: Fixed
@lukeis

This comment has been minimized.

Show comment
Hide comment
@lukeis

lukeis Mar 4, 2016

Member
the current IE driver is throwing now an ElementNotVisible exception if opacity = 0.
the current fireforx driver is not throwing an exception and is interacting with such
an element.

we have for example in our web application a styled browse button. for this the opacity
is set to 0.
Now I can not test this element with IE anymore.

A user can interact with Elements which have an opacity of 0. It is possible for a
user to write into an input field with opacity = 0. So for my understanding opacity
= 0 is not equal to not visible and I would strongly recommend to roleback this change
or to have an option whether to ignore opacity or not if it is my wish.

Reported by padder784 on 2014-03-25 08:34:58

Member

lukeis commented Mar 4, 2016

the current IE driver is throwing now an ElementNotVisible exception if opacity = 0.
the current fireforx driver is not throwing an exception and is interacting with such
an element.

we have for example in our web application a styled browse button. for this the opacity
is set to 0.
Now I can not test this element with IE anymore.

A user can interact with Elements which have an opacity of 0. It is possible for a
user to write into an input field with opacity = 0. So for my understanding opacity
= 0 is not equal to not visible and I would strongly recommend to roleback this change
or to have an option whether to ignore opacity or not if it is my wish.

Reported by padder784 on 2014-03-25 08:34:58

@lukeis

This comment has been minimized.

Show comment
Hide comment
@lukeis

lukeis Mar 4, 2016

Member

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

  • Labels added: Restrict-AddIssueComment-Commit
Member

lukeis commented Mar 4, 2016

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

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this 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.