-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
[dotnet] Enable ShadowRoot to use By
query mechanism
#15336
base: trunk
Are you sure you want to change the base?
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
ShadowRoot
to use the element query mechanism inBy
Motivation and Context
Fixes #15335
Types of changes
Checklist
PR Type
Bug fix, Tests
Description
Enabled
ShadowRoot
to useBy
query mechanism for element searching.Added
FindElement
andFindElements
methods toShadowRoot
for consistency.Introduced new tests to validate
By
methods inShadowRoot
.Enhanced error handling for null
By
arguments inShadowRoot
.Changes walkthrough 📝
ShadowRoot.cs
Add `By` query mechanism support to `ShadowRoot`
dotnet/src/webdriver/ShadowRoot.cs
IFindsElement
interface inShadowRoot
.FindElement
andFindElements
methods usingBy
.FindElement
andFindElements
with mechanismand value parameters.
By
arguments.ShadowRootHandlingTest.cs
Add tests for `ShadowRoot` `By` query mechanism
dotnet/test/common/ShadowRootHandlingTest.cs
ShadowRoot
usingBy
methods.FindElement
andFindElements
functionality inShadowRoot
.