-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] Enable ShadowRoot to use By query mechanism
#15336
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
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
| parameters.Add("using", by.Mechanism); | ||
| parameters.Add("value", by.Criteria); | ||
| parameters.Add("using", mechanism); | ||
| parameters.Add("value", value); |
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.
Problem - RelativeBy. Before this PR, calling this with a relative locator would have Mechanism = "" and Criteria = "". The exception would be confusing, but still clear something is wrong here.
Now, it does a full-document search and ignores the shadow root. I think this is the worst of all options: wrong behavior.
For that reason, I propose we explicitly throw if we have relative locators + shadow root queries.
User description
Enables
ShadowRootto use the element query mechanism inByMotivation and Context
Fixes #15335
Types of changes
Checklist
PR Type
Bug fix, Tests
Description
Enabled
ShadowRootto useByquery mechanism for element searching.Added
FindElementandFindElementsmethods toShadowRootfor consistency.Introduced new tests to validate
Bymethods inShadowRoot.Enhanced error handling for null
Byarguments inShadowRoot.Changes walkthrough 📝
ShadowRoot.cs
Add `By` query mechanism support to `ShadowRoot`dotnet/src/webdriver/ShadowRoot.cs
IFindsElementinterface inShadowRoot.FindElementandFindElementsmethods usingBy.FindElementandFindElementswith mechanismand value parameters.
Byarguments.ShadowRootHandlingTest.cs
Add tests for `ShadowRoot` `By` query mechanismdotnet/test/common/ShadowRootHandlingTest.cs
ShadowRootusingBymethods.FindElementandFindElementsfunctionality inShadowRoot.