-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] Add WindowSwitcher class #16359
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
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:
|
Thank you, @arnonax-tr for this code suggestion. The support packages contain example code that many users find helpful, but they do not necessarily represent After reviewing the change, unless it is a critical fix or a feature that is needed for Selenium We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks. |
PR Code Suggestions ✨Explore these optional code suggestions:
|
ca28435
to
719b13f
Compare
Regarding the 2 other PR Code Suggestions, I don't think they're relevant:
If you're using the
I don't think we should swallow a |
User description
💥 What does this PR do?
Adds a helper class
WindowSwitcher
and an extension methodWithWindowOpenedBy
that facilitates switching between windows.For example:
🔄 Types of changes
PR Type
Enhancement
Description
Add
WindowSwitcher
class for managing browser window switchingAdd
WithWindowOpenedBy
extension method for WebDriverInclude comprehensive unit tests for window switching functionality
Provide fluent API for handling popup windows
Diagram Walkthrough
File Walkthrough
WebDriverExtensions.cs
Add window switching extension method
dotnet/src/support/Extensions/WebDriverExtensions.cs
WithWindowOpenedBy
extension method for IWebDriverOpenQA.Selenium.Support.UI
namespaceWindowSwitcher.cs
New WindowSwitcher class implementation
dotnet/src/support/UI/WindowSwitcher.cs
WindowSwitcher
class with window management functionalityDo()
method for safe window switching with automatic returnSwitchToNewWindow()
andSwitchToOriginalWindow()
methodsWindowSwitcherTest.cs
Unit tests for WindowSwitcher
dotnet/test/support/UI/WindowSwitcherTest.cs