Appium driver, selenium driver Upgrade#4225
Conversation
WalkthroughThe changes update NuGet package versions for System.Drawing.Common, Appium.WebDriver, and Selenium.WebDriver across multiple project files. In addition, the SeleniumDriver class is updated to use Selenium DevTools protocol version 136, and the GenericAppiumDriver's unlocking logic is refined to use conditional checks and explicit parameters. Changes
Sequence Diagram(s)sequenceDiagram
participant TestRunner
participant GenericAppiumDriver
participant AndroidDevice
TestRunner->>GenericAppiumDriver: PerformLockButtonPress(LockOperation)
GenericAppiumDriver->>AndroidDevice: IsLocked()
alt Device is locked
GenericAppiumDriver->>AndroidDevice: Unlock("none", "none")
end
sequenceDiagram
participant SeleniumDriver
participant DevToolsV136
SeleniumDriver->>DevToolsV136: Enable Network Domain
SeleniumDriver->>DevToolsV136: Set Blocked URLs
SeleniumDriver->>DevToolsV136: Unblock URLs
SeleniumDriver->>DevToolsV136: Disable Network Domain
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (6)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (5)
Ginger/Ginger/Ginger.csproj(1 hunks)Ginger/GingerCore/GingerCore.csproj(1 hunks)Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs(4 hunks)Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs(5 hunks)Ginger/GingerCoreNET/GingerCoreNET.csproj(3 hunks)
🔇 Additional comments (14)
Ginger/Ginger/Ginger.csproj (1)
754-754: Approved: BumpSystem.Drawing.Commonto 8.0.10
Minor version upgrade aligns with related project updates and brings in the latest fixes.Ginger/GingerCore/GingerCore.csproj (1)
554-556: Upgrade System.Drawing.Common to 8.0.10 – Approved
The patch release bump aligns with other project files and brings in the latest fixes and performance improvements.Ginger/GingerCoreNET/GingerCoreNET.csproj (3)
229-229: Validate major bump of Appium.WebDriver to 7.2.0
Upgrading from 5.x to 7.x may introduce breaking changes. Please run and update mobile integration tests (especially around unlocking behavior inGenericAppiumDriver) to ensure full API compatibility.
334-334: Upgrade Selenium.WebDriver to 4.33.0 – Approved
This minor version bump aligns with the DevTools protocol update inSeleniumDriver(v136). No issues detected.
343-343: Sync System.Drawing.Common to 8.0.10 – Approved
Bumping this package here ensures consistency with theGingerCore.csprojupdate.Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (5)
75-75: LGTM: DevTools import alias updated consistently.The import alias update from V127 to V136 is consistent with the Selenium DevTools protocol upgrade.
10901-10901: LGTM: DevTools Network.Enable command updated consistently.The Network.Enable command is correctly updated to use V136.Network.EnableCommandSettings, maintaining consistency with the DevTools version upgrade.
10957-10961: LGTM: SetBlockedURLs commands updated consistently.Both SetBlockedURLs command calls are correctly updated to use V136.Network.SetBlockedURLsCommandSettings. The logic for setting blocked URLs and clearing them (empty array) is preserved.
4008-4008:Details
❓ Verification inconclusive
Verify the exception type change behavior.
The exception type changed from
ElementNotVisibleExceptiontoNoSuchElementException. This could indicate a behavioral change in Selenium WebDriver 4.33.0 that needs verification to ensure the same error conditions are still being caught appropriately.
🏁 Script executed:
#!/bin/bash # Description: Search for other usages of ElementNotVisibleException to check if they need similar updates rg -A 3 -B 3 "ElementNotVisibleException"Length of output: 41
Confirm updated exception handling for hidden elements
Selenium .NET 4.33.0 has deprecated
ElementNotVisibleExceptionin favor of throwingNoSuchElementException. Please verify that scenarios where elements exist but are hidden still trigger this catch:
- Review the Selenium 4.33.0 release notes or source to confirm the removal of
ElementNotVisibleException.- Run or add tests for hidden elements to ensure the new exception is caught as expected.
11051-11051:Details
❓ Verification inconclusive
LGTM: Network.Disable command updated consistently.
The Network.Disable command is correctly updated to use V136.Network.DisableCommandSettings, completing the consistent DevTools version upgrade across all network-related commands.
Verify the DevTools protocol version compatibility.
The upgrade from V127 to V136 represents a significant version jump. Please verify that all DevTools functionality works correctly with the new version and that no breaking changes affect the existing network monitoring and URL blocking features.
🌐 Web query:
What are the breaking changes between Selenium DevTools V127 and V136?💡 Result:
Between Selenium DevTools versions V127 and V136, several breaking changes have been introduced:
Java BiDi API Import Changes: In Selenium 4.19 and later, the import paths for BiDi-related classes in Java have been updated. Previously, imports like
import org.openqa.selenium.bidi.LogInspector;were used. After the update, the correct import statements areimport org.openqa.selenium.bidi.module.LogInspector;and similar for other modules. This change was implemented to resolve circular dependencies in the build tool Bazel and to align with best practices. (selenium.dev)Deprecation of
getAttributeMethod: Selenium 4.27 has deprecated thegetAttributemethod across multiple language bindings. Users are encouraged to usegetDomProperty(String)orgetDomAttribute(String)for more precise attribute retrieval. This deprecation aims to enhance the accuracy and reliability of attribute access. (selenium.dev)CDP Version Support Changes: Selenium 4.27 introduced support for Chrome DevTools Protocol (CDP) versions v127, v128, and v131, while removing support for v121. This change ensures compatibility with the latest browser versions and aligns with evolving automation standards. (selenium.dev)
Deprecation of CDP Methods for Firefox: To align with evolving automation standards, several CDP methods for Firefox have been deprecated across various bindings in Selenium 4.27. Users should transition to alternative methods to maintain compatibility. (selenium.dev)
Selenium Manager Interface Changes: Selenium Manager has undergone interface changes to improve maintainability and performance. Users who previously invoked Selenium Manager directly may experience issues due to these updates. It's recommended to review the latest documentation for proper usage. (chromium.googlesource.com)
These changes are part of Selenium's ongoing efforts to enhance functionality, performance, and compatibility with modern web standards.
Citations:
- 1: https://www.selenium.dev/blog/2024/bidi-java-breaking-change/?utm_source=openai
- 2: https://www.selenium.dev/blog/2024/selenium-4-27-released/?utm_source=openai
- 3: https://www.selenium.dev/blog/2024/selenium-4-27-released/?utm_source=openai
- 4: https://www.selenium.dev/blog/2024/selenium-4-27-released/?utm_source=openai
- 5: https://chromium.googlesource.com/external/github.com/SeleniumHQ/selenium/%2B/HEAD/java/CHANGELOG?utm_source=openai
Verify DevTools Protocol V136 Compatibility in .NET
The
Network.Disablecall has been updated to useV136.Network.DisableCommandSettingsas expected. However, Selenium’s release notes between CDP v127 and v136 cite several breaking changes (notably Java BiDi imports, attribute‐access deprecations, and shifts in supported CDP versions) that could have .NET counterparts. Please confirm:
- The Selenium.WebDriver.DevTools NuGet package has been bumped to the version that supports CDP v136.
- All network-related features (monitoring, URL blocking, etc.) are exercised against ChromeDriver/CDP v136 in your E2E test suite.
- Any uses of
getAttributein your .NET bindings are reviewed and, if necessary, replaced withGetDomProperty()orGetDomAttribute().File needing attention:
• Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (around line 11051)Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs (4)
58-58: LGTM! Essential import for Android device operations.The addition of
OpenQA.Selenium.Appium.Android.Enumsimport is necessary to support the newIsLocked()method used in the updated unlock logic.
78-78: Good practice to avoid namespace conflicts.The explicit alias for
PointerInputDevicehelps prevent ambiguity between different pointer input device implementations in the upgraded Appium WebDriver.
1970-1973: Excellent improvement with defensive programming.The conditional check using
IsLocked()before callingUnlock("none", "none")is a significant improvement that:
- Prevents unnecessary unlock operations on already unlocked devices
- Aligns with the new Appium WebDriver 7.2.0 API requiring explicit parameters
- Implements defensive programming practices
This change enhances reliability and prevents potential runtime errors.
4818-4818: Consistent with updated API requirements.The use of
Unlock("none", "none")with explicit parameters is consistent with the Appium WebDriver 7.2.0 upgrade and matches the implementation in thePerformLockButtonPressmethod.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
Ginger/Ginger/Ginger.csproj (1)
754-754: Ensure consistent System.Drawing.Common version across all projects
The bump to Version="9.0.5" is appropriate, but please verify that all.csprojfiles in the solution referencingSystem.Drawing.Commonhave been updated to9.0.5to prevent assembly binding conflicts.Run this script to identify any mismatches:
#!/bin/bash # Identify csproj files not using System.Drawing.Common v9.0.5 rg -L '<PackageReference Include="System.Drawing.Common" Version="9\.0\.5"' -g '*.csproj'
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (6)
Ginger/Ginger/Ginger.csproj(1 hunks)Ginger/GingerCore/GingerCore.csproj(1 hunks)Ginger/GingerCoreCommon/GingerCoreCommon.csproj(1 hunks)Ginger/GingerCoreNET/GingerCoreNET.csproj(3 hunks)Ginger/GingerPluginCore/GingerPluginCore.csproj(1 hunks)Ginger/GingerUtils/GingerUtils.csproj(1 hunks)
🔇 Additional comments (7)
Ginger/GingerCore/GingerCore.csproj (1)
554-556: Align System.Drawing.Common version across projects
The bump from 8.0.7 to 9.0.5 ensures consistency with other solution projects.Ginger/GingerUtils/GingerUtils.csproj (1)
21-21: Bump System.Drawing.Common to 9.0.5
This update aligns theSystem.Drawing.Commondependency version with related projects.Ginger/GingerCoreCommon/GingerCoreCommon.csproj (1)
45-45: Upgrade System.Drawing.Common to 9.0.5
Consistent version upgrade across core-common assemblies for uniform dependency management.Ginger/GingerPluginCore/GingerPluginCore.csproj (1)
19-19: Update System.Drawing.Common to 9.0.5
Maintains version alignment with other Ginger projects to avoid runtime mismatches.Ginger/GingerCoreNET/GingerCoreNET.csproj (3)
343-343: Align System.Drawing.Common to 9.0.5 in CoreNET
This matches the version across all projects, preventing potential assembly binding issues.
334-334:Details
❓ Verification inconclusive
Confirm Selenium.WebDriver 4.33.0 supports DevTools Protocol 136
The bump to 4.33.0 aligns with the DevTools protocol update; ensure no regressions in SeleniumDriver.
🏁 Script executed:
#!/bin/bash # Check for DevTools protocol version usage in SeleniumDriver rg -n "DevToolsProtocol" -g "GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs"Length of output: 241
Manual verification required: Confirm Selenium.WebDriver 4.33.0 supports DevTools Protocol 136
I searched for anyDevToolsProtocolreferences in our SeleniumDriver implementation and found none. Please double-check that the 4.33.0 release adds Protocol 136 support and that upgrading won’t introduce regressions.• Project file: Ginger/GingerCoreNET/GingerCoreNET.csproj (line 334)
• Checked implementation: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (noDevToolsProtocolusage found)
229-229:Details
✅ Verification successful
Ensure Appium.WebDriver 7.2.0 compatibility
Verify that GenericAppiumDriver implementations accommodate any breaking changes between Appium.WebDriver 5.x and 7.x.
🏁 Script executed:
#!/bin/bash # Verify GenericAppiumDriver uses updated Appium.WebDriver APIs rg -n "GenericAppiumDriver" -g "GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs"Length of output: 250
🏁 Script executed:
#!/bin/bash # Locate GenericAppiumDriver.cs anywhere in the repo echo "Searching for GenericAppiumDriver.cs..." file=$(fd --hidden --glob "GenericAppiumDriver.cs" 2>/dev/null | head -n1) if [ -z "$file" ]; then echo "ERROR: GenericAppiumDriver.cs not found in repository." exit 1 fi echo "Found file at: $file" echo echo "Inspecting for Appium.WebDriver API usage..." # Check imports and key types rg -n "using OpenQA.Selenium.Appium" -C2 "$file" || true rg -n "AppiumOptions" -C2 "$file" || true rg -n "AppiumDriver<" -C2 "$file" || true rg -n "OpenQA.Selenium.Appium." -C2 "$file" || trueLength of output: 2292
Appium.WebDriver 7.2.0 compatibility confirmed
GenericAppiumDriver.cs has been updated to use the new AppiumOptions API (no more DesiredCapabilities) and imports only the current OpenQA.Selenium.Appium namespaces. No breaking-change patterns from 5.x remain.• File inspected:
– Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.csNo further action required.
Thank you for your contribution.
Before submitting this PR, please make sure:
Summary by CodeRabbit
Bug Fixes
Chores