-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for shadow elements #7808
Add support for shadow elements #7808
Conversation
@@ -524,6 +524,9 @@ bot.inject.cache.getElement = function(key, opt_doc) { | |||
if (node == doc.documentElement) { | |||
return el; | |||
} | |||
if (node.host && node.nodeType === 11) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of host I think that you want to node.ownerDocument
to check if fragment is still attached.
Does this work on ShadowDOM as they are not document fragments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did the change.
I use that other way to try to keep the same code style. I think that it was valid (according to the last W3C). However I think that your recommendation is faster.
…iego-fernandez-santos/selenium into hotfix/atoms-shadowdom-support
This latest iteration doesn't work on MobileSafari, on any version of iOS I try. The first solution did work. At the point of failure, |
X
in the preceding checkbox, I verify that I have signed the Contributor License AgreementAtoms checks if an element is still attached to the DOM before every interaction. This check is done here. The problem is that it doesn't take into account shadow elements. These elements doesn't have a parentNode but they can still be attached to the DOM, for example shadowRoot elements.
If you try to interact with WebComponents in IPhone an "Element is no longer attached to the DOM" error would be raised.
I do this pull request in this branch because this is the current version that appium-remote-debugger currently using.
You can replicate this problem directly in the browser following the next steps:
You can see that getElementIfAttached doesn't return the element although the shop-button is still attached to the DOM.