I need to access this page chrome://downloads/ and check that a file has been downloaded but it\'s Shadow DOM.
I\'ve found this article how to access DOM Elements With S
I wanted to let people know that this monkey patch no longer works and I do not know of a good work around.
The initial problem that Justin solved was that a shadow dom attached to an element actually doesn't have a tag name. Hence his monkey patch. But with updates, that patch no longer works. The initial error is a change in JS errors (see bullet #1 below). The new problem is that shadow dom's are attached to real elements, but the shadowRoot itself is not a real element. It's like a quasi-element.
Selenium::WebDriver::Error::JavascriptError, so your rescue line needs updated for the correct error.javascript error: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element' This is the result of an internal API call on the wire protocol. For example, I traced the error to selenium-webdriver-3.142.7/lib/selenium/webdriver/remote/http/default.rb:81 The API call returns an internal 500 error with a payload of "{"value":{"error":"javascript error","message":"javascript error: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.\n (Session info: chrome=87.0.4280.88)" I do not know how to get around this.