Skip to content

Appium driver, selenium driver Upgrade#4225

Merged
Maheshkale447 merged 4 commits into
masterfrom
Feature/AppiumUpgrade
Jun 2, 2025
Merged

Appium driver, selenium driver Upgrade#4225
Maheshkale447 merged 4 commits into
masterfrom
Feature/AppiumUpgrade

Conversation

@prashelke

@prashelke prashelke commented May 30, 2025

Copy link
Copy Markdown
Contributor

Thank you for your contribution.
Before submitting this PR, please make sure:

  • PR description and commit message should describe the changes done in this PR
  • Verify the PR is pointing to correct branch i.e. Release or Beta branch if the code fix is for specific release , else point it to master
  • Latest Code from master or specific release branch is merged to your branch
  • No unwanted\commented\junk code is included
  • No new warning upon build solution
  • Code Summary\Comments are added to my code which explains what my code is doing
  • Existing unit test cases are passed
  • New Unit tests are added for your development
  • Sanity Tests are successfully executed for New and Existing Functionality
  • Verify that changes are compatible with all relevant browsers and platforms.
  • After creating pull request there should not be any conflicts
  • Resolve all Codacy comments
  • Builds and checks are passed before PR is sent for review
  • Resolve code review comments
  • Update the Help Library document to match any feature changes

Summary by CodeRabbit

  • Bug Fixes

    • Improved Android device unlocking behavior to check lock status before unlocking and updated unlock method parameters for reliability.
    • Updated exception handling during web interactions for more accurate error reporting.
  • Chores

    • Upgraded several underlying libraries, including Appium, Selenium, and System.Drawing.Common, to enhance compatibility and stability.

@coderabbitai

coderabbitai Bot commented May 30, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The 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

Files/Groups Change Summary
Ginger/Ginger/Ginger.csproj
Ginger/GingerCore/GingerCore.csproj
Ginger/GingerCoreCommon/GingerCoreCommon.csproj
Ginger/GingerPluginCore/GingerPluginCore.csproj
Ginger/GingerUtils/GingerUtils.csproj
Updated System.Drawing.Common package version from 8.0.7 to 9.0.5.
Ginger/GingerCoreNET/GingerCoreNET.csproj Upgraded System.Drawing.Common to 9.0.5, Appium.WebDriver from 5.1.0 to 7.2.0, and Selenium.WebDriver from 4.23.0 to 4.33.0.
Ginger/GingerCoreNET/Drivers/CoreDrivers/Mobile/Appium/GenericAppiumDriver.cs Updated Android unlock logic to check device lock state before unlocking and use Unlock("none", "none") overload.
Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs Migrated DevTools usage from protocol version 127 to 136; changed exception handling in ClickButton method from ElementNotVisibleException to NoSuchElementException.

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
Loading
sequenceDiagram
    participant SeleniumDriver
    participant DevToolsV136

    SeleniumDriver->>DevToolsV136: Enable Network Domain
    SeleniumDriver->>DevToolsV136: Set Blocked URLs
    SeleniumDriver->>DevToolsV136: Unblock URLs
    SeleniumDriver->>DevToolsV136: Disable Network Domain
Loading

Possibly related PRs

Suggested reviewers

  • Maheshkale447

Poem

A hop, a skip, a version bump—
New packages in the garden stump.
Selenium talks in fresher code,
Appium unlocks on a safer road.
Drawing lines now sharper, neat—
This codebase hops with lighter feet!
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f8ef09 and 7ad60ad.

📒 Files selected for processing (1)
  • Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (6 hunks)
🔇 Additional comments (6)
Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (6)

75-75: DevTools import alias updated correctly.

The import alias has been properly updated to use V136 namespace, which aligns with the Selenium WebDriver upgrade to version 4.33.0.


103-103: Protocol version constant updated appropriately.

The DevToolsProtocolVersion constant has been updated from 127 to 136, which is consistent with the DevTools V136 namespace usage throughout the file. This addresses the previous review comment about updating the version number.


4008-4011: Exception handling improved with proper logging.

The changes address two improvements:

  1. Updated exception type from ElementNotVisibleException to NoSuchElementException, which is more appropriate for element location failures
  2. Added error logging as requested in the previous review comment

This enhances debugging capabilities when elements cannot be found.


10902-10902: Network.Enable command updated to V136.

The DevTools Network.Enable command has been correctly updated to use the V136 namespace and corresponding EnableCommandSettings class.


10958-10962: Network.SetBlockedURLs commands updated consistently.

Both blocked and unblocked URL operations have been updated to use V136 namespace and SetBlockedURLsCommandSettings class. The implementation correctly handles both scenarios:

  • Setting blocked URLs with the provided array
  • Clearing blocked URLs with an empty array

11052-11052: Network.Disable command updated to V136.

The DevTools Network.Disable command has been correctly updated to use the V136 namespace and corresponding DisableCommandSettings class, maintaining consistency with other DevTools command updates.

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between da7f9ac and 3cf794f.

📒 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: Bump System.Drawing.Common to 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 in GenericAppiumDriver) 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 in SeleniumDriver (v136). No issues detected.


343-343: Sync System.Drawing.Common to 8.0.10 – Approved
Bumping this package here ensures consistency with the GingerCore.csproj update.

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 ElementNotVisibleException to NoSuchElementException. 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 ElementNotVisibleException in favor of throwing NoSuchElementException. 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:

  1. 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 are import 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)

  2. Deprecation of getAttribute Method: Selenium 4.27 has deprecated the getAttribute method across multiple language bindings. Users are encouraged to use getDomProperty(String) or getDomAttribute(String) for more precise attribute retrieval. This deprecation aims to enhance the accuracy and reliability of attribute access. (selenium.dev)

  3. 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)

  4. 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)

  5. 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:


Verify DevTools Protocol V136 Compatibility in .NET

The Network.Disable call has been updated to use V136.Network.DisableCommandSettings as 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 getAttribute in your .NET bindings are reviewed and, if necessary, replaced with GetDomProperty() or GetDomAttribute().

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.Enums import is necessary to support the new IsLocked() method used in the updated unlock logic.


78-78: Good practice to avoid namespace conflicts.

The explicit alias for PointerInputDevice helps 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 calling Unlock("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 the PerformLockButtonPress method.

Comment thread Ginger/Ginger/Ginger.csproj Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .csproj files in the solution referencing System.Drawing.Common have been updated to 9.0.5 to 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

📥 Commits

Reviewing files that changed from the base of the PR and between 3cf794f and 2f8ef09.

📒 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 the System.Drawing.Common dependency 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 any DevToolsProtocol references 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 (no DevToolsProtocol usage 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" || true

Length 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.cs

No further action required.

Comment thread Ginger/Ginger/Ginger.csproj
@prashelke
prashelke requested a review from Maheshkale447 May 30, 2025 07:30
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 2, 2025
@Maheshkale447
Maheshkale447 merged commit 401eb1f into master Jun 2, 2025
@Maheshkale447
Maheshkale447 deleted the Feature/AppiumUpgrade branch June 2, 2025 17:05
@coderabbitai coderabbitai Bot mentioned this pull request Mar 11, 2026
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants