element.click triggers Selenium::WebDriver::Error::UnknownError: Element is obscured error

Fixed Issue #14838046

Details

Author
Mark D.
Created
Nov 27, 2017
Privacy
This issue is public.
Found in
  • Microsoft Edge
Found in build #
15.15063
Reports
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Issue
I’m not sure what is triggering this, but at some point I can get the edge browser (or driver) into a state where it cannot click on elements anymore (see examples below).
It keeps on working on Chrome and FF and this issue only seems related to Edge.
I don’t know how to get out of this state either.
Maybe also good to know is that I can use element.fire_event(‘onclick’) so it’s not like the browser/driver is/are completely unresponsive.

Watir + ruby bindings

irb(main):001:0> require 'watir'
=> true
irb(main):002:0> browser = Watir::Browser.new :edge
=> #<Watir::Browser:0xe1aecc6 url="about:blank" title="">
irb(main):003:0> browser.goto "https://google.com"
=> "https://google.com"
irb(main):004:0> browser.input(id: 'lst-ib').click
Selenium::WebDriver::Error::UnknownError: Element is obscured
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/response.rb:69:in `assert_ok'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/response.rb:32:in `initialize'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/http/common.rb:81:in `new'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/http/common.rb:81:in `create_response'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/http/default.rb:104:in `request'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/http/common.rb:59:in `call'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/bridge.rb:168:in `execute'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/w3c/bridge.rb:535:in `execute'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/w3c/bridge.rb:358:in `click_element'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/element.rb:72:in `click'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/watir-6.9.1/lib/watir/elements/element.rb:134:in `block in click'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/watir-6.9.1/lib/watir/elements/element.rb:657:in `element_call'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/watir-6.9.1/lib/watir/elements/element.rb:125:in `click'
        from (irb):4
        from C:/Ruby23/bin/irb.cmd:19:in `<main>'
irb(main):005:0>

Selenium + Ruby bindings

irb(main):001:0> require 'selenium-webdriver'
=> true
irb(main):002:0> driver = Selenium::WebDriver.for :edge
=> #<Selenium::WebDriver::Edge::Driver:0x..f9ea28d6c browser=:MicrosoftEdge>
irb(main):003:0> driver.navigate.to "http://google.com"
=> nil
irb(main):004:0> driver.find_element(:id, "lst-ib").click
Selenium::WebDriver::Error::UnknownError: Element is obscured
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/response.rb:69:in `assert_ok'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/response.rb:32:in `initialize'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/http/common.rb:81:in `new'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/http/common.rb:81:in `create_response'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/http/default.rb:104:in `request'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/http/common.rb:59:in `call'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/bridge.rb:168:in `execute'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/w3c/bridge.rb:535:in `execute'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/remote/w3c/bridge.rb:358:in `click_element'
        from C:/Ruby23/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.7.0/lib/selenium/webdriver/common/element.rb:72:in `click'
        from (irb):4
        from C:/Ruby23/bin/irb.cmd:19:in `<main>'
irb(main):005:0>

Attachments

0 attachments

    Comments and activity

    • My setup
      Windows 10 (x64)
      Microsoft Edge 40.15063.674.0
      Microsoft EdgeHTML 15.15063
      Edgedriver 15063
      ruby 2.3.3 (x86)
      ruby gem watir 6.9.1
      ruby gem selenium-webdriver 3.7.0

    • Microsoft Edge Team

      Changed Assigned To to “Steven K.”

    • Hi Mark,

      Are you adjusting the zoom level during the test?  Is the default zoom level for the browser set to 100%?  This is a known defect for zoom levels other than 100%.

      Steve

    • I’m not aware of any test perfoming a zoom in. But I’ll take a look at it and let you know what I find since I did notice that the zoom level is currently at 125%. But that still does not explain why the issue sometimes disappears right? Or is this zoom level sometimes giving issues, but not always? (would still be weird, but would explain what I see is going on)

    • I found the guilty part that made this issue appear and disappear. It was not any test that did this. But me moving the Edge window between monitors.
      My laptop screen is slightly smaller than my external monitors.
      When Edge is at 100% zoom on my external monitor and I move it to my laptop monitor, zoom becomes 125%.
      When Edge is at 100% zoom on my laptop monitor and I move it to my external monitor, zoom becomes 80%.
      So that is why I had no clue why this kept on showing up and also disappear what looked like out of the blue. And first I blamed my test suite for triggering something, but in the end it was just me moving screens around.

      I have one more related question.
      Besides sending ctrl+0 keys, is there any other trick I can apply to my test automation to keep it at 100% during the test run to it will not change while the test is running?

    • Great find.  Glad we got that sorted out.  I will pass on this information about the screens changing and causing issues due to the zoom level auto-changes.  You have this set in your display properties for each display?

      There isn’t anything that I am aware to force the zoom to 100%.  I didn’t know about your idea using the ctrl+0.  Thanks for sharing that.  I know a feature request is to support profiles and then a “testing profile” could be created to make sure any user changes were not accidentally applied.  This would not correct the issue with moving between screens with different resolutions or DPI (moving from 4k to non-4k).

      I will duplicate this ticket to the other know zoom issue, if it is public and I can find it.  :-)

      Thanks again for the submission and letting us know about the root cause,

      Steve

    • Hi Steve,
      Thanks for the quick response on this matter. Without your hint to the zoom level it would have taken me way more time to figure it out.

      Right now I’ve set the Windows Display settings zoom level of each display to 100%, so I should not run into this issue anymore (unless there will be some driver update that will reset this setting). The test machine is a Azure VM, so for the test run it should all be fine, it was more an issue on my local machine.

      I’ll try to find the “testing profile” request so I can follow the progress and give it a try once it’s ready.

      Cheers, Mark

    • The profile feature request can be seen in the "Feeback Hub".  Win + S and type feedback.  Then in the app search for profiles.  There appears to be two of the same requests.  I upvoted the one with the high number of votes.  :)

      Thanks again,

      Steve

    • Microsoft Edge Team

      Changed Assigned To to “edgedevtoolstri@microsoft.com”

      Changed Assigned To from “edgedevtoolstri@microsoft.com” to “John J.”

      Changed Status to “Confirmed”

      Changed Status from “Confirmed” to “Fixed”

    You need to sign in to your Microsoft account to add a comment.

    Sign in