Skip to content

Updated Unix Console action and Double click for Windows enhancement#4305

Merged
Maheshkale447 merged 6 commits into
masterfrom
BugFix/UnixConsoleActionEnhacement
Sep 19, 2025
Merged

Updated Unix Console action and Double click for Windows enhancement#4305
Maheshkale447 merged 6 commits into
masterfrom
BugFix/UnixConsoleActionEnhacement

Conversation

@prashelke

@prashelke prashelke commented Sep 18, 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

  • New Features

    • Console: added a "Command Terminator" selector with info tooltip; console sending now uses the selected terminator.
    • UI Automation: added Double Click and Mouse Double Click actions across many element types, plus a dedicated coordinate resolution and fallback double-click strategy.
  • Bug Fixes

    • Click reliability: XY actions now auto-calculate missing/unreliable coordinates from element bounds for more consistent clicks.

@coderabbitai

coderabbitai Bot commented Sep 18, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Adds a configurable command terminator (UI, model enum, driver wiring) and stops auto-appending newlines for console sends. Introduces double-click and mouse-double-click support in Windows UI automation with WinAPI double-click, helper fallbacks, coordinate resolution, enum/action additions, and platform action list updates.

Changes

Cohort / File(s) Summary
Console command terminator
Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml, Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs, Ginger/GingerCore/Actions/ActConsoleCommand.cs, Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverBase.cs, Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverWindow.xaml.cs
Adds a Command Terminator UI (ComboBox + info icon) and handler; adds ActConsoleCommand.eCommandEndKey enum and CommandEndKey property plus CommandValueAttribute; adds ConsoleDriverBase.GetCommandValue and uses it when composing commands; ConsoleDriverWindow stops appending automatic newlines and sends raw input.
Windows UI double-click support
Ginger/GingerCore/Actions/UIAutomation/WinAPIAutomation.cs, Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs, Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs, Ginger/GingerCoreNET/Run/Platforms/PlatformsInfo/PlatformInfoBase.cs, Ginger/GingerCoreNET/Run/Platforms/PlatformsInfo/WindowsPlatform.cs, Ginger/GingerCoreCommon/Actions/UI Element/ActUIElement.cs
Adds DoubleSendClick in WinAPIAutomation; adds DoubleClickElement, MouseDoubleClickElement, and pattern-based fallbacks in UIElementOperationsHelper; WindowsDriver routes new DoubleClick/MouseDoubleClick actions and centralizes coordinate resolution via GetCoOrdinate; ActUIElement enum and platform action lists updated to include DoubleClick/MouseDoubleClick/DoubleClickXY where applicable.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as ActConsoleCommandEditPage
  participant Model as ActConsoleCommand
  participant Driver as ConsoleDriverBase
  participant Console as Console Endpoint

  User->>UI: Select Command Terminator
  UI->>Model: set CommandEndKey
  User->>Driver: Run Action (send command)
  Driver->>Driver: GetCommandValue(CommandEndKey)
  Note right of Driver: resolve CommandValueAttribute<br/>and apply platform rules
  Driver->>Console: Send CommandText + terminator
  Console-->>Driver: Response
Loading
sequenceDiagram
  autonumber
  actor User
  participant Runner as WindowsDriver
  participant Helper as UIElementOperationsHelper
  participant API as WinAPIAutomation
  participant UIA as AutomationElement

  User->>Runner: Execute ActUIElement(DoubleClick | MouseDoubleClick)
  alt DoubleClick (logical)
    Runner->>Helper: DoubleClickElement(UIA)
    Helper->>UIA: Try InvokePattern twice
    alt invoke fallback failure
      Helper->>UIA: Try Legacy DoDefaultAction twice
    else both fail
      Helper->>API: DoubleSendClick(UIA)
    end
  else MouseDoubleClick (mouse)
    Runner->>Helper: MouseDoubleClickElement(UIA)
    Helper->>API: DoubleSendClick(UIA)
    API->>API: Foreground element, compute center, two clicks (100ms gap)
  end
  Note over Runner,Helper: Execution info/errors logged and returned
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • Maheshkale447
  • MeniKadosh1

Poem

I thump my paws: click-click, what a trick!
Two hops for buttons, precise and quick.
Terminators chosen, commands set free,
No more stray newlines — neat as can be.
Rabbity joy for automation glee 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description contains only the repository checklist template and does not describe the actual code changes, rationale, testing performed, target branch, build status, or documentation updates, so it does not meet the repository's expectation for a filled PR description. Because key information such as a summary of changes, affected files/areas, verification steps, and any migration or compatibility notes is missing, reviewers cannot assess scope, risk, or readiness for merge from the current description alone. Please replace the checklist placeholder with a completed description that includes a concise summary of what changed and why, list of key modified files or areas, testing and build results (existing and new unit/sanity tests), the intended target branch and merge notes, and any required documentation or compatibility impact so reviewers can evaluate and approve the PR.
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title succinctly and accurately captures the two main changes in the diff: updates to the Unix console/command behavior and an enhancement for double-click handling on Windows, which correspond to the ConsoleDriver/ActConsoleCommand modifications and the added double-click methods/enum updates. It is concise, specific, and relevant to the changeset, so a reviewer scanning history can understand the primary intent without noise.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch BugFix/UnixConsoleActionEnhacement

📜 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 20441fa and 05f2b62.

📒 Files selected for processing (1)
  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs (4 hunks)
🧰 Additional context used
🧠 Learnings (7)
📚 Learning: 2025-09-04T15:43:57.789Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:9146-9291
Timestamp: 2025-09-04T15:43:57.789Z
Learning: In SeleniumDriver.cs, prefer using the C# fallback GenerateEnhancedSvgXPath(IWebElement) for SVG XPath generation instead of injecting/validating a JavaScript-based XPath builder. This was accepted in PR Ginger-Automation/Ginger#4294.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-09-04T16:40:09.511Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:6019-6061
Timestamp: 2025-09-04T16:40:09.511Z
Learning: In Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (AddSvgSpecificLocators, around lines ~6000–6065) for PR Ginger-Automation/Ginger#4294, maintainer prashelke indicated that adjusting XPath to remove outer quotes around EscapeXPathString(...) is not required. Do not suggest changing the quoting around EscapeXPathString for SVG-specific locators in future reviews unless maintainers request it.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-07-10T07:11:28.974Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4249
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:4684-4695
Timestamp: 2025-07-10T07:11:28.974Z
Learning: In Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs, attribute values used in CSS selectors (e.g., ByTitle, ByAriaLabel, ByDataTestId, ByPlaceholder) should be escaped using a helper method (such as EscapeCssAttributeValue) to prevent selector breakage due to special characters.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-09-04T16:40:33.092Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:9182-9223
Timestamp: 2025-09-04T16:40:33.092Z
Learning: In PR Ginger-Automation/Ginger#4294 (SeleniumDriver.cs GenerateSvgAttributeBasedXPath), maintainer declined changing XPath to remove extra quotes around EscapeXPathString(...) results; keep current quoting as-is in this area for now.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-09-04T15:42:00.330Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:8334-8350
Timestamp: 2025-09-04T15:42:00.330Z
Learning: In PR Ginger-Automation/Ginger#4294, SeleniumDriver.cs: maintainer requested to keep the WebElement-based helper IsSvgElementByWebElement(IWebElement) and its current usages for now, deferring the replacement with GetElementTypeEnum(..) + IsSvgElement(eElementType) to a later PR.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-09-04T09:55:20.543Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:5789-5796
Timestamp: 2025-09-04T09:55:20.543Z
Learning: In Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (around line 5786), maintainer prashelke prefers to keep the helper method `IsSvgElement(eElementType)` as-is (no inlining or renaming), even though it currently checks only for `eElementType.Svg`. Future reviews should not suggest removing or renaming this helper.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-06-16T10:37:13.073Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4232
File: Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs:19-22
Timestamp: 2025-06-16T10:37:13.073Z
Learning: In Ginger codebase, both `using amdocs.ginger.GingerCoreNET;` and `using Amdocs.Ginger.CoreNET;` are valid and serve different purposes. The first (lowercase) contains the WorkSpace class and related workspace functionality, while the second (proper case) contains drivers like GenericAppiumDriver and other core functionality. Both may be required in files that use types from both namespaces.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
🧬 Code graph analysis (1)
Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs (3)
Ginger/GingerCore/Actions/UIAutomation/UIAComWrapperHelper.cs (17)
  • System (567-590)
  • System (6880-6891)
  • UIAuto (371-399)
  • UIAuto (696-713)
  • UIAuto (715-737)
  • UIAuto (739-771)
  • UIAuto (831-848)
  • UIAuto (1010-1039)
  • UIAuto (1110-1145)
  • UIAuto (1215-1384)
  • UIAuto (1387-1391)
  • UIAuto (1491-1510)
  • UIAuto (1532-1578)
  • UIAuto (1580-1616)
  • UIAuto (1618-1644)
  • UIAuto (3027-3038)
  • UIAuto (3637-3667)
Ginger/GingerCoreCommon/Actions/UI Element/ActUIElement.cs (2)
  • ActUIElement (33-1073)
  • Fields (71-147)
Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (2)
  • ActUIElement (9663-9682)
  • DoubleClickXY (3718-3722)
🔇 Additional comments (4)
Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs (4)

44-45: LGTM! Appropriate UI Automation namespace usage.

The System.Windows.Automation using directive and the UIAuto alias for UIAComWrapperNetstandard::System.Windows.Automation are correctly added to support the new double-click functionality and coordinate resolution features.


421-426: LGTM! Double-click functionality properly implemented.

The implementation correctly routes both DoubleClick and MouseDoubleClick actions to appropriate helper methods from UIElementOperationsHelper.


436-449: LGTM! Coordinate-based actions centralized through GetCoOrdinate.

The ClickXY, DoubleClickXY, and RightClickXY actions are properly updated to use the centralized GetCoOrdinate helper method for coordinate resolution. This provides consistent coordinate handling across all XY-based actions.


608-672: LGTM! Excellent coordinate resolution implementation with comprehensive error handling.

The GetCoOrdinate method implementation is well-designed with:

  • Proper element-relative coordinates: Returns offsets relative to element rather than absolute screen coordinates
  • Robust input parsing: Uses int.TryParse instead of direct parsing to prevent exceptions
  • Comprehensive fallback logic: Handles all scenarios (missing X, missing Y, unparseable values)
  • Zero-size rectangle protection: Guards against elements with width/height ≤ 0
  • Exception resilience: Graceful fallback when bounding rectangle can't be read
  • Clear documentation: Well-documented XML comments explain the method's purpose and behavior

This addresses the coordinate double-offset issues mentioned in past reviews and provides a solid foundation for XY-based UI automation actions.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@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: 9

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
Ginger/GingerCoreNET/Run/Platforms/PlatformsInfo/WindowsPlatform.cs (1)

86-93: Windows action surface expansion is coherent; consider click‑type list parity

Adding DoubleClick/MouseDoubleClick (and DoubleClickXY) across types looks consistent. If you want these to be selectable in ClickAndValidate’s fallback loop, update GetPlatformUIClickTypeList to include DoubleClick and MouseDoubleClick; otherwise, current behavior (Click/MouseClick/AsyncClick only) is intentional but inconsistent with the exposed actions.

Proposed method body (outside the changed hunk) if parity is desired:

public override List<ActUIElement.eElementAction> GetPlatformUIClickTypeList()
{
    return new List<ActUIElement.eElementAction>
    {
        ActUIElement.eElementAction.Click,
        ActUIElement.eElementAction.MouseClick,
        ActUIElement.eElementAction.AsyncClick,
        ActUIElement.eElementAction.DoubleClick,
        ActUIElement.eElementAction.MouseDoubleClick,
    };
}

Also applies to: 114-124, 160-167, 170-178, 180-189, 200-209, 220-231, 258-265, 274-283

Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs (1)

848-861: Wire new actions into PerformClick switch

DoubleClick and MouseDoubleClick aren’t handled here, risking no-op if callers route via PerformClick.

Apply this diff:

                 case ActUIElement.eElementAction.MouseClick:
                     actionResult = MouseClickElement(automationElement);
                     break;
+                case ActUIElement.eElementAction.DoubleClick:
+                    actionResult = DoubleClickElement(automationElement);
+                    break;
+                case ActUIElement.eElementAction.MouseDoubleClick:
+                    actionResult = MouseDoubleClickElement(automationElement);
+                    break;
Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverBase.cs (1)

150-183: ExInfo doesn’t reflect the actually sent command

You set act.ExInfo before appending the terminator, so logs don’t show the exact payload. Move ExInfo assignment after composing the final command.

-                    string command = GetCommandText(ACC);
-                    act.ExInfo = command;
+                    string command = GetCommandText(ACC);
...
-                            if (Platform == GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib.ePlatformType.Unix)
-                            {
-                                command = $"{command}{GetCommandValue(ACC.CommandEndKey)}";
-                            }
-                            else if(ACC.CommandEndKey== eCommandEndKey.Enter)
-                            {
-                                command = $"{command}\r{GetCommandValue(ACC.CommandEndKey)}";
-                            }
-                            else
-                            {
-                                command = $"{command}{GetCommandValue(ACC.CommandEndKey)}";
-                            }
-                            sRC = mConsoleDriverWindow.RunConsoleCommand(command);
+                            var finalCommand = command;
+                            if (Platform == GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib.ePlatformType.Unix)
+                                finalCommand = $"{command}{GetCommandValue(ACC.CommandEndKey)}";
+                            else if (ACC.CommandEndKey == eCommandEndKey.Enter)
+                                finalCommand = $"{command}\r{GetCommandValue(ACC.CommandEndKey)}";
+                            else
+                                finalCommand = $"{command}{GetCommandValue(ACC.CommandEndKey)}";
+                            act.ExInfo = finalCommand;
+                            sRC = mConsoleDriverWindow.RunConsoleCommand(finalCommand);

Also set act.ExInfo = command in the Script branch to keep parity.

Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverWindow.xaml.cs (1)

81-92: Set taskFinished for both paths and append Enter terminator for manual sends

Verified: UnixShellDriver.SSHRunCommand (ss.Write(command)) and DOSConsoleDriver.SendCommand (writer.Write(command)) send raw text and do not append terminators — manual UI sends must add the Enter terminator and set taskFinished before sending.

Apply (file: Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverWindow.xaml.cs, lines ~81-92):

-            //Checking Console Driver Platform
-            if (mConsoleDriver.Platform.ToString() == "Unix")
+            //Checking Console Driver Platform
+            mConsoleDriver.taskFinished = false;
+            if (mConsoleDriver.Platform.ToString() == "Unix")
             {
                 //Unix then only \n is required
-                mConsoleDriver.taskFinished = false;
-                mConsoleDriver.SendCommand(CommandTextBox.Text);
+                mConsoleDriver.SendCommand($"{CommandTextBox.Text}{ConsoleDriverBase.GetCommandValue(GingerCore.Actions.ActConsoleCommand.eCommandEndKey.Enter)}");
             }
             else
             {
                 //Dos then \r\n is required
-                mConsoleDriver.SendCommand(CommandTextBox.Text);
+                mConsoleDriver.SendCommand($"{CommandTextBox.Text}\r{ConsoleDriverBase.GetCommandValue(GingerCore.Actions.ActConsoleCommand.eCommandEndKey.Enter)}");
             }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e177f5d and c01ef5c.

📒 Files selected for processing (11)
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml (2 hunks)
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs (3 hunks)
  • Ginger/GingerCore/Actions/ActConsoleCommand.cs (4 hunks)
  • Ginger/GingerCore/Actions/UIAutomation/WinAPIAutomation.cs (1 hunks)
  • Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs (2 hunks)
  • Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverBase.cs (3 hunks)
  • Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverWindow.xaml.cs (1 hunks)
  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs (4 hunks)
  • Ginger/GingerCoreCommon/Actions/UI Element/ActUIElement.cs (1 hunks)
  • Ginger/GingerCoreNET/Run/Platforms/PlatformsInfo/PlatformInfoBase.cs (1 hunks)
  • Ginger/GingerCoreNET/Run/Platforms/PlatformsInfo/WindowsPlatform.cs (9 hunks)
🧰 Additional context used
🧠 Learnings (7)
📚 Learning: 2025-09-04T09:34:04.299Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreCommon/UIElement/ElementInfo.cs:555-569
Timestamp: 2025-09-04T09:34:04.299Z
Learning: In Ginger/GingerCoreCommon/UIElement/ElementInfo.cs, the eLearnedType.AI enum value should be retained as it's required for future AI development features, as confirmed by prashelke.

Applied to files:

  • Ginger/GingerCoreCommon/Actions/UI Element/ActUIElement.cs
📚 Learning: 2024-07-26T22:04:12.930Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#3429
File: Ginger/Ginger/AutomatePageLib/AddActionMenu/WindowExplorer/Common/WindowExplorerPage.xaml.cs:1123-1126
Timestamp: 2024-07-26T22:04:12.930Z
Learning: The user has removed an unnecessary empty line at 1123 in `WindowExplorerPage.xaml.cs` for better code compactness.

Applied to files:

  • Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverWindow.xaml.cs
📚 Learning: 2025-09-04T15:43:57.789Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:9146-9291
Timestamp: 2025-09-04T15:43:57.789Z
Learning: In SeleniumDriver.cs, prefer using the C# fallback GenerateEnhancedSvgXPath(IWebElement) for SVG XPath generation instead of injecting/validating a JavaScript-based XPath builder. This was accepted in PR Ginger-Automation/Ginger#4294.

Applied to files:

  • Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs
  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-06-16T10:37:13.073Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4232
File: Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs:19-22
Timestamp: 2025-06-16T10:37:13.073Z
Learning: In Ginger codebase, both `using amdocs.ginger.GingerCoreNET;` and `using Amdocs.Ginger.CoreNET;` are valid and serve different purposes. The first (lowercase) contains the WorkSpace class and related workspace functionality, while the second (proper case) contains drivers like GenericAppiumDriver and other core functionality. Both may be required in files that use types from both namespaces.

Applied to files:

  • Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverBase.cs
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs
  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
  • Ginger/GingerCore/Actions/ActConsoleCommand.cs
📚 Learning: 2025-04-25T13:29:45.059Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#4188
File: Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs:22-23
Timestamp: 2025-04-25T13:29:45.059Z
Learning: The `using Amdocs.Ginger.Repository;` statement in Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs is necessary as it provides access to the `ObservableList<>` class which is used throughout the file for collections of RunSetConfig, AnalyzerItemBase, and ApplicationPOMModel objects.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs
  • Ginger/GingerCore/Actions/ActConsoleCommand.cs
📚 Learning: 2025-04-25T13:29:45.059Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#4188
File: Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs:22-23
Timestamp: 2025-04-25T13:29:45.059Z
Learning: The `using Amdocs.Ginger.Repository;` statement in Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs is necessary as it imports the ObservableList<> class which is used throughout the file.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs
  • Ginger/GingerCore/Actions/ActConsoleCommand.cs
📚 Learning: 2025-03-20T11:10:30.816Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#4137
File: Ginger/Ginger/SourceControl/SourceControlProjectsPage.xaml.cs:21-21
Timestamp: 2025-03-20T11:10:30.816Z
Learning: The `Amdocs.Ginger.Common.SourceControlLib` namespace is required in files that reference the `GingerSolution` class for source control operations in the Ginger automation framework.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs
  • Ginger/GingerCore/Actions/ActConsoleCommand.cs
🧬 Code graph analysis (7)
Ginger/GingerCoreNET/Run/Platforms/PlatformsInfo/PlatformInfoBase.cs (2)
Ginger/GingerCoreCommon/Actions/UI Element/ActUIElement.cs (1)
  • ActUIElement (33-1073)
Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (1)
  • ActUIElement (9663-9682)
Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverWindow.xaml.cs (1)
Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverBase.cs (1)
  • SendCommand (61-61)
Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs (2)
Ginger/GingerCoreCommon/ReporterLib/Reporter.cs (1)
  • Reporter (28-357)
Ginger/GingerCore/Actions/UIAutomation/WinAPIAutomation.cs (1)
  • DoubleSendClick (386-403)
Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverBase.cs (1)
Ginger/GingerCore/Actions/ActConsoleCommand.cs (2)
  • ActConsoleCommand (29-131)
  • CommandValueAttribute (138-141)
Ginger/GingerCoreNET/Run/Platforms/PlatformsInfo/WindowsPlatform.cs (2)
Ginger/GingerCoreCommon/Actions/UI Element/ActUIElement.cs (1)
  • ActUIElement (33-1073)
Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (3)
  • ActUIElement (9663-9682)
  • ClickXY (3708-3712)
  • DoubleClickXY (3718-3722)
Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs (3)
Ginger/GingerCore/Actions/ActConsoleCommand.cs (1)
  • ActConsoleCommand (29-131)
Ginger/GingerCore/GeneralLib/General.cs (1)
  • FillComboFromEnumObj (147-210)
Ginger/GingerCore/GeneralLib/InputBoxWindow.xaml.cs (1)
  • ObjFieldBinding (147-157)
Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs (2)
Ginger/GingerCore/Actions/UIAutomation/UIAComWrapperHelper.cs (17)
  • System (567-590)
  • System (6880-6891)
  • UIAuto (371-399)
  • UIAuto (696-713)
  • UIAuto (715-737)
  • UIAuto (739-771)
  • UIAuto (831-848)
  • UIAuto (1010-1039)
  • UIAuto (1110-1145)
  • UIAuto (1215-1384)
  • UIAuto (1387-1391)
  • UIAuto (1491-1510)
  • UIAuto (1532-1578)
  • UIAuto (1580-1616)
  • UIAuto (1618-1644)
  • UIAuto (3027-3038)
  • UIAuto (3637-3667)
Ginger/GingerCoreCommon/Actions/UI Element/ActUIElement.cs (2)
  • ActUIElement (33-1073)
  • Fields (71-147)
🔇 Additional comments (4)
Ginger/GingerCoreCommon/Actions/UI Element/ActUIElement.cs (1)

249-251: New enum value MouseDoubleClick: looks good; verify end-to-end wiring

Enum member addition is fine and matches the PR intent. Please confirm:

  • WindowsPlatform and WindowsDriver support are complete (added in this PR).
  • Any UI/editor surfaces that bind to eElementAction are refreshed so the new item appears as expected.
Ginger/GingerCoreNET/Run/Platforms/PlatformsInfo/PlatformInfoBase.cs (1)

236-237: Button now supports DoubleClick: OK

Change is consistent with platform additions. Please sanity‑check non‑Windows platforms gracefully ignore DoubleClick where unimplemented.

Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs (1)

421-426: New DoubleClick/MouseDoubleClick handling: OK

Routing to mUIElementOperationsHelper is aligned with the platform changes.

Ginger/GingerCore/Actions/ActConsoleCommand.cs (1)

133-142: Attribute implementation fine; no issues

CommandValueAttribute is minimal and correct for the reflection use in the driver.

Comment thread Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs Outdated
Comment thread Ginger/GingerCore/Actions/ActConsoleCommand.cs
Comment thread Ginger/GingerCore/Actions/ActConsoleCommand.cs Outdated
Comment thread Ginger/GingerCore/Actions/UIAutomation/WinAPIAutomation.cs
Comment thread Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs
Comment thread Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs
Comment thread Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverBase.cs
Comment thread Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs

@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: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs (1)

405-425: Treat 0 offsets as valid XY and fix right-click messages

  • Using x!=0 && y!=0 drops legitimate 0 offsets; always pass the provided coordinates.
  • RightClickElementUsingXY uses “double clicked” messages; correct to “right‑clicked”.

Apply this diff:

 public ActionResult DoubleClickElementUsingXY(UIAuto.AutomationElement automationElement, int xCoordinate, int yCoordinate)
 {
     ActionResult actionResult = new ActionResult();
     try
     {
-        string xy = string.Empty;
-        if (xCoordinate != 0 && yCoordinate != 0)
-        {
-            xy = xCoordinate + "," + yCoordinate;
-        }
-
-        winAPI.SendDoubleClick(automationElement, xy);
-        actionResult.executionInfo = "Successfully double clicked the element";
+        string xy = xCoordinate + "," + yCoordinate; // allow 0 offsets
+        winAPI.SendDoubleClick(automationElement, xy);
+        actionResult.executionInfo = "Successfully double-clicked the element";
     }
     catch (Exception ex)
     {
-        Reporter.ToLog(eLogLevel.DEBUG, "Exception in docule click Element", ex);
-        actionResult.errorMessage = "Failed to Double click the element";
+        Reporter.ToLog(eLogLevel.DEBUG, "Exception in DoubleClickElementUsingXY", ex);
+        actionResult.errorMessage = "Failed to double-click the element";
     }
     return actionResult;
 }
 
 public ActionResult RightClickElementUsingXY(UIAuto.AutomationElement automationElement, int xCoordinate, int yCoordinate)
 {
     ActionResult actionResult = new ActionResult();
     try
     {
-        string xy = string.Empty;
-        if (xCoordinate != 0 && yCoordinate != 0)
-        {
-            xy = xCoordinate + "," + yCoordinate;
-        }
-
-        winAPI.SendRightClick(automationElement, xy);
-        actionResult.executionInfo = "Successfully double clicked the element";
+        string xy = xCoordinate + "," + yCoordinate; // allow 0 offsets
+        winAPI.SendRightClick(automationElement, xy);
+        actionResult.executionInfo = "Successfully right-clicked the element";
     }
     catch (Exception ex)
     {
-        Reporter.ToLog(eLogLevel.DEBUG, "Exception in docule click Element", ex);
-        actionResult.errorMessage = "Failed to Double click the element";
+        Reporter.ToLog(eLogLevel.DEBUG, "Exception in RightClickElementUsingXY", ex);
+        actionResult.errorMessage = "Failed to right-click the element";
     }
     return actionResult;
 }

Also applies to: 427-447

♻️ Duplicate comments (2)
Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs (2)

63-66: Binding is correct; event becomes redundant

SelectedValue two-way binding updates the model; the SelectionChanged handler can be removed.

-            List<object> CommandList = GetCommandKey();
-            GingerCore.General.FillComboFromEnumObj(CommandTerminatorComboBox, actConsoleCommand.CommandEndKey, CommandList);
+            GingerCore.General.FillComboFromEnumObj(CommandTerminatorComboBox, actConsoleCommand.CommandEndKey, null);
             GingerCore.GeneralLib.BindingHandler.ObjFieldBinding(CommandTerminatorComboBox, ComboBox.SelectedValueProperty, actConsoleCommand, nameof(ActConsoleCommand.CommandEndKey));

140-144: Delete redundant SelectionChanged handler

Two-way SelectedValue binding makes this unnecessary.

-        private void CommandTerminatorComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-            if (CommandTerminatorComboBox.SelectedValue is ActConsoleCommand.eCommandEndKey key)
-                mActConsoleCommand.CommandEndKey = key;
-        }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c01ef5c and a284a3d.

📒 Files selected for processing (6)
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml (2 hunks)
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs (3 hunks)
  • Ginger/GingerCore/Actions/ActConsoleCommand.cs (4 hunks)
  • Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs (3 hunks)
  • Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverBase.cs (3 hunks)
  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs (4 hunks)
🧰 Additional context used
🧠 Learnings (13)
📚 Learning: 2025-04-25T13:29:45.059Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#4188
File: Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs:22-23
Timestamp: 2025-04-25T13:29:45.059Z
Learning: The `using Amdocs.Ginger.Repository;` statement in Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs is necessary as it provides access to the `ObservableList<>` class which is used throughout the file for collections of RunSetConfig, AnalyzerItemBase, and ApplicationPOMModel objects.

Applied to files:

  • Ginger/GingerCore/Actions/ActConsoleCommand.cs
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs
📚 Learning: 2025-04-25T13:29:45.059Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#4188
File: Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs:22-23
Timestamp: 2025-04-25T13:29:45.059Z
Learning: The `using Amdocs.Ginger.Repository;` statement in Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs is necessary as it imports the ObservableList<> class which is used throughout the file.

Applied to files:

  • Ginger/GingerCore/Actions/ActConsoleCommand.cs
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs
📚 Learning: 2025-03-20T11:10:30.816Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#4137
File: Ginger/Ginger/SourceControl/SourceControlProjectsPage.xaml.cs:21-21
Timestamp: 2025-03-20T11:10:30.816Z
Learning: The `Amdocs.Ginger.Common.SourceControlLib` namespace is required in files that reference the `GingerSolution` class for source control operations in the Ginger automation framework.

Applied to files:

  • Ginger/GingerCore/Actions/ActConsoleCommand.cs
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs
📚 Learning: 2025-08-26T07:40:08.345Z
Learnt from: AmanPrasad43
PR: Ginger-Automation/Ginger#4285
File: Ginger/Ginger/Actions/ActionEditPages/ActSecurityTestingEditPage.xaml:23-23
Timestamp: 2025-08-26T07:40:08.345Z
Learning: In the Ginger codebase ActSecurityTestingEditPage.xaml file, the large bottom margin of 530 on the "Acceptable Alerts" label (Margin="10,10,0,530") is intentional design choice, not an error.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml
📚 Learning: 2025-04-30T13:21:34.994Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4193
File: Ginger/Ginger/ApplicationModelsLib/POMModels/POMWizardLib/LearnWizard/AIGeneratedPreviewWizardPage.xaml.cs:131-138
Timestamp: 2025-04-30T13:21:34.994Z
Learning: In AIGeneratedPreviewWizardPage.xaml.cs, the current code checks if the response ends with triple backticks and removes them manually. This method is fragile and should be replaced with a more robust regex-based parser. The user plans to address this in a future update.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml
📚 Learning: 2025-09-04T16:40:09.511Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:6019-6061
Timestamp: 2025-09-04T16:40:09.511Z
Learning: In Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (AddSvgSpecificLocators, around lines ~6000–6065) for PR Ginger-Automation/Ginger#4294, maintainer prashelke indicated that adjusting XPath to remove outer quotes around EscapeXPathString(...) is not required. Do not suggest changing the quoting around EscapeXPathString for SVG-specific locators in future reviews unless maintainers request it.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml
  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-09-04T16:40:33.092Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:9182-9223
Timestamp: 2025-09-04T16:40:33.092Z
Learning: In PR Ginger-Automation/Ginger#4294 (SeleniumDriver.cs GenerateSvgAttributeBasedXPath), maintainer declined changing XPath to remove extra quotes around EscapeXPathString(...) results; keep current quoting as-is in this area for now.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml
  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-06-16T10:37:13.073Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4232
File: Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs:19-22
Timestamp: 2025-06-16T10:37:13.073Z
Learning: In Ginger codebase, both `using amdocs.ginger.GingerCoreNET;` and `using Amdocs.Ginger.CoreNET;` are valid and serve different purposes. The first (lowercase) contains the WorkSpace class and related workspace functionality, while the second (proper case) contains drivers like GenericAppiumDriver and other core functionality. Both may be required in files that use types from both namespaces.

Applied to files:

  • Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverBase.cs
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs
  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-08-28T09:29:59.151Z
Learnt from: AmanPrasad43
PR: Ginger-Automation/Ginger#4286
File: Ginger/Ginger/Drivers/DriversConfigsEditPages/WebServicesDriverEditPage.xaml.cs:149-152
Timestamp: 2025-08-28T09:29:59.151Z
Learning: In Ginger's WebServicesDriverEditPage.xaml.cs, the FillComboItemsFromEnumType method should be used instead of FillComboFromEnumType when sorting by enum order is required. FillComboItemsFromEnumType preserves EnumValueDescription display through WPF's automatic ToString() calling on enum Content, and provides built-in sorting functionality via SortDescriptions.Add("text", Ascending). This was confirmed by AmanPrasad43 in PR #4286 for the ZAP vulnerability type dropdown.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs
📚 Learning: 2025-09-04T15:43:57.789Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:9146-9291
Timestamp: 2025-09-04T15:43:57.789Z
Learning: In SeleniumDriver.cs, prefer using the C# fallback GenerateEnhancedSvgXPath(IWebElement) for SVG XPath generation instead of injecting/validating a JavaScript-based XPath builder. This was accepted in PR Ginger-Automation/Ginger#4294.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-07-10T07:11:28.974Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4249
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:4684-4695
Timestamp: 2025-07-10T07:11:28.974Z
Learning: In Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs, attribute values used in CSS selectors (e.g., ByTitle, ByAriaLabel, ByDataTestId, ByPlaceholder) should be escaped using a helper method (such as EscapeCssAttributeValue) to prevent selector breakage due to special characters.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-09-04T15:42:00.330Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:8334-8350
Timestamp: 2025-09-04T15:42:00.330Z
Learning: In PR Ginger-Automation/Ginger#4294, SeleniumDriver.cs: maintainer requested to keep the WebElement-based helper IsSvgElementByWebElement(IWebElement) and its current usages for now, deferring the replacement with GetElementTypeEnum(..) + IsSvgElement(eElementType) to a later PR.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-09-04T09:55:20.543Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:5789-5796
Timestamp: 2025-09-04T09:55:20.543Z
Learning: In Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (around line 5786), maintainer prashelke prefers to keep the helper method `IsSvgElement(eElementType)` as-is (no inlining or renaming), even though it currently checks only for `eElementType.Svg`. Future reviews should not suggest removing or renaming this helper.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
🧬 Code graph analysis (4)
Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverBase.cs (1)
Ginger/GingerCore/Actions/ActConsoleCommand.cs (2)
  • ActConsoleCommand (30-132)
  • CommandValueAttribute (139-142)
Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs (3)
Ginger/GingerCore/Actions/ActConsoleCommand.cs (2)
  • ActConsoleCommand (30-132)
  • Fields (116-127)
Ginger/GingerCore/GeneralLib/General.cs (1)
  • FillComboFromEnumObj (147-210)
Ginger/GingerCore/GeneralLib/InputBoxWindow.xaml.cs (1)
  • ObjFieldBinding (147-157)
Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs (1)
Ginger/GingerCoreCommon/Actions/UI Element/ActUIElement.cs (2)
  • ActUIElement (33-1073)
  • Fields (71-147)
Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs (2)
Ginger/GingerCore/Actions/UIAutomation/WinAPIAutomation.cs (1)
  • DoubleSendClick (386-403)
Ginger/GingerCoreCommon/ReporterLib/Reporter.cs (1)
  • Reporter (28-357)
🔇 Additional comments (11)
Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs (2)

421-426: Windows double-click actions correctly wired

Switch cases delegate to helper methods as expected. No issues.


435-450: XY actions now use centralized, element-relative coordinate resolver — good

Routing ClickXY/DoubleClickXY/RightClickXY through GetCoOrdinate removes prior double-offset risk.

Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs (2)

321-350: Pattern + WinAPI fallback for double-click is correct

Sequence is robust and logs are appropriate.


370-384: MouseDoubleClickElement implementation looks good

Direct WinAPI double-click with clear success/error messages.

Ginger/GingerCore/Actions/ActConsoleCommand.cs (3)

70-85: Enum mapping looks solid

Clear value-to-display mapping; “None” for Empty improves UX.


105-106: Default/back-compat: confirm deserialization behavior

You set both a default initializer and DefaultValue on the serialized property. Please confirm legacy actions (saved before this PR) deserialize with Enter when CommandEndKey is absent.


26-26: Remove unused using (if not adding [DefaultValue])

System.ComponentModel appears unused in this file; drop it unless you plan to add [DefaultValue].

-using System.ComponentModel;

Likely an incorrect or invalid review comment.

Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverBase.cs (3)

31-31: Static import usage is fine

Using the nested enum via static import keeps call sites clean.


123-134: Robust, cached attribute lookup

Thread-safe cache + guards remove reflection from hot path. LGTM.

Add a quick unit to assert mappings don’t regress:

  • Enter -> "\n"
  • Tab -> "\t"
  • Space -> " "
  • Empty -> ""

174-185: Platform-terminator logic: make platform checks explicit and verify no hidden newline

Current else branch applies to any non-Unix platform; prefer explicit DOS to avoid surprises if new platforms appear. Also verify ConsoleDriverWindow.RunConsoleCommand no longer appends newline, to prevent CR/LF duplication.

-                            if (Platform == GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib.ePlatformType.Unix)
+                            if (Platform == GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib.ePlatformType.Unix)
                             {
                                 command = $"{command}{GetCommandValue(ACC.CommandEndKey)}";
                             }
-                            else if(ACC.CommandEndKey== eCommandEndKey.Enter)
+                            else if (Platform == GingerCoreNET.SolutionRepositoryLib.RepositoryObjectsLib.PlatformsLib.ePlatformType.DOS
+                                     && ACC.CommandEndKey == eCommandEndKey.Enter)
                             {
                                 command = $"{command}\r{GetCommandValue(ACC.CommandEndKey)}";
                             }
                             else
                             {
                                 command = $"{command}{GetCommandValue(ACC.CommandEndKey)}";
                             }
Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml (1)

6-6: Namespace import is fine

Adds required namespace for ImageMakerControl.

Comment thread Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs Outdated
Comment thread Ginger/GingerCore/Actions/ActConsoleCommand.cs Outdated
Comment thread Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs
Comment thread Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs Outdated
Comment thread Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 19, 2025

@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 (4)
Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs (3)

582-583: Consider using system double-click time instead of hardcoded 100ms

The 100ms delay between clicks might be too fast on some systems. Consider using the system's double-click time for better reliability.

Based on the previous discussion about SystemInformation.DoubleClickTime limitations, you could use:

-                    Thread.Sleep(100);
+                    Thread.Sleep(500); // Use Windows default double-click time

Or implement the Win32 API approach mentioned in the learnings:

[DllImport("user32.dll")]
private static extern uint GetDoubleClickTime();

private static int GetSystemDoubleClickTime()
{
    try
    {
        uint time = GetDoubleClickTime();
        return time > 0 ? (int)time : 500;
    }
    catch
    {
        return 500; // Windows default
    }
}

617-617: Fix typo: extra space in success message

Line 617 has "Successfully double-click the element" with two spaces between "double-click" and "the".

Apply this diff:

-                            actionResult.executionInfo = "Successfully double-click  the element";
+                            actionResult.executionInfo = "Successfully double-clicked the element";

584-584: Fix typo in success message

Line 584 has "Successfully double-click" but should be "Successfully double-clicked" for consistency.

Apply this diff:

-                    actionResult.executionInfo = "Successfully double-click the element";
+                    actionResult.executionInfo = "Successfully double-clicked the element";
Ginger/GingerCore/Actions/ActConsoleCommand.cs (1)

134-143: Make the constructor internal to match internal sealed class.

Minor API tightening: constructor doesn’t need to be public within an internal sealed attribute.

Apply this diff:

-        public CommandValueAttribute(string value)
+        internal CommandValueAttribute(string value)
         {
             Value = value;
         }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a284a3d and b54a88e.

📒 Files selected for processing (6)
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml (2 hunks)
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs (3 hunks)
  • Ginger/GingerCore/Actions/ActConsoleCommand.cs (4 hunks)
  • Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs (3 hunks)
  • Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverBase.cs (3 hunks)
  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs (4 hunks)
🧰 Additional context used
🧠 Learnings (15)
📚 Learning: 2025-09-04T15:43:57.789Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:9146-9291
Timestamp: 2025-09-04T15:43:57.789Z
Learning: In SeleniumDriver.cs, prefer using the C# fallback GenerateEnhancedSvgXPath(IWebElement) for SVG XPath generation instead of injecting/validating a JavaScript-based XPath builder. This was accepted in PR Ginger-Automation/Ginger#4294.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-09-04T16:40:09.511Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:6019-6061
Timestamp: 2025-09-04T16:40:09.511Z
Learning: In Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (AddSvgSpecificLocators, around lines ~6000–6065) for PR Ginger-Automation/Ginger#4294, maintainer prashelke indicated that adjusting XPath to remove outer quotes around EscapeXPathString(...) is not required. Do not suggest changing the quoting around EscapeXPathString for SVG-specific locators in future reviews unless maintainers request it.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml
📚 Learning: 2025-07-10T07:11:28.974Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4249
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:4684-4695
Timestamp: 2025-07-10T07:11:28.974Z
Learning: In Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs, attribute values used in CSS selectors (e.g., ByTitle, ByAriaLabel, ByDataTestId, ByPlaceholder) should be escaped using a helper method (such as EscapeCssAttributeValue) to prevent selector breakage due to special characters.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-09-04T16:40:33.092Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:9182-9223
Timestamp: 2025-09-04T16:40:33.092Z
Learning: In PR Ginger-Automation/Ginger#4294 (SeleniumDriver.cs GenerateSvgAttributeBasedXPath), maintainer declined changing XPath to remove extra quotes around EscapeXPathString(...) results; keep current quoting as-is in this area for now.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml
📚 Learning: 2025-09-04T15:42:00.330Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:8334-8350
Timestamp: 2025-09-04T15:42:00.330Z
Learning: In PR Ginger-Automation/Ginger#4294, SeleniumDriver.cs: maintainer requested to keep the WebElement-based helper IsSvgElementByWebElement(IWebElement) and its current usages for now, deferring the replacement with GetElementTypeEnum(..) + IsSvgElement(eElementType) to a later PR.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-09-04T09:55:20.543Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:5789-5796
Timestamp: 2025-09-04T09:55:20.543Z
Learning: In Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (around line 5786), maintainer prashelke prefers to keep the helper method `IsSvgElement(eElementType)` as-is (no inlining or renaming), even though it currently checks only for `eElementType.Svg`. Future reviews should not suggest removing or renaming this helper.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-06-16T10:37:13.073Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4232
File: Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs:19-22
Timestamp: 2025-06-16T10:37:13.073Z
Learning: In Ginger codebase, both `using amdocs.ginger.GingerCoreNET;` and `using Amdocs.Ginger.CoreNET;` are valid and serve different purposes. The first (lowercase) contains the WorkSpace class and related workspace functionality, while the second (proper case) contains drivers like GenericAppiumDriver and other core functionality. Both may be required in files that use types from both namespaces.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
  • Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverBase.cs
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs
📚 Learning: 2025-04-30T13:21:34.994Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4193
File: Ginger/Ginger/ApplicationModelsLib/POMModels/POMWizardLib/LearnWizard/AIGeneratedPreviewWizardPage.xaml.cs:131-138
Timestamp: 2025-04-30T13:21:34.994Z
Learning: In AIGeneratedPreviewWizardPage.xaml.cs, the current code checks if the response ends with triple backticks and removes them manually. This method is fragile and should be replaced with a more robust regex-based parser. The user plans to address this in a future update.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml
📚 Learning: 2024-07-26T22:04:12.930Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#3429
File: Ginger/Ginger/AutomatePageLib/AddActionMenu/WindowExplorer/Common/WindowExplorerPage.xaml.cs:1123-1126
Timestamp: 2024-07-26T22:04:12.930Z
Learning: The user has removed an unnecessary empty line at 1123 in `WindowExplorerPage.xaml.cs` for better code compactness.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml
📚 Learning: 2024-07-26T22:04:12.930Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#3429
File: Ginger/Ginger/AutomatePageLib/AddActionMenu/WindowExplorer/Common/WindowExplorerPage.xaml.cs:1139-1142
Timestamp: 2024-07-26T22:04:12.930Z
Learning: The user has updated the code by removing or addressing the commented code as suggested in the review.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml
📚 Learning: 2025-04-25T13:29:45.059Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#4188
File: Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs:22-23
Timestamp: 2025-04-25T13:29:45.059Z
Learning: The `using Amdocs.Ginger.Repository;` statement in Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs is necessary as it provides access to the `ObservableList<>` class which is used throughout the file for collections of RunSetConfig, AnalyzerItemBase, and ApplicationPOMModel objects.

Applied to files:

  • Ginger/GingerCore/Actions/ActConsoleCommand.cs
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs
📚 Learning: 2025-04-25T13:29:45.059Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#4188
File: Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs:22-23
Timestamp: 2025-04-25T13:29:45.059Z
Learning: The `using Amdocs.Ginger.Repository;` statement in Ginger/GingerCoreNET/RunLib/CLILib/DoOptionsHanlder.cs is necessary as it imports the ObservableList<> class which is used throughout the file.

Applied to files:

  • Ginger/GingerCore/Actions/ActConsoleCommand.cs
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs
📚 Learning: 2025-03-20T11:10:30.816Z
Learnt from: GokulBothe99
PR: Ginger-Automation/Ginger#4137
File: Ginger/Ginger/SourceControl/SourceControlProjectsPage.xaml.cs:21-21
Timestamp: 2025-03-20T11:10:30.816Z
Learning: The `Amdocs.Ginger.Common.SourceControlLib` namespace is required in files that reference the `GingerSolution` class for source control operations in the Ginger automation framework.

Applied to files:

  • Ginger/GingerCore/Actions/ActConsoleCommand.cs
  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs
📚 Learning: 2025-09-19T07:30:42.943Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4305
File: Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs:321-350
Timestamp: 2025-09-19T07:30:42.943Z
Learning: User prashelke indicates that System.Windows.Forms.SystemInformation.DoubleClickTime is not supported after Windows 6.1 (Windows 7) and later versions. Alternative approaches include using Win32 GetDoubleClickTime() API directly or using reasonable default values like 500ms for double-click timing.

Applied to files:

  • Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs
📚 Learning: 2025-08-28T09:29:59.151Z
Learnt from: AmanPrasad43
PR: Ginger-Automation/Ginger#4286
File: Ginger/Ginger/Drivers/DriversConfigsEditPages/WebServicesDriverEditPage.xaml.cs:149-152
Timestamp: 2025-08-28T09:29:59.151Z
Learning: In Ginger's WebServicesDriverEditPage.xaml.cs, the FillComboItemsFromEnumType method should be used instead of FillComboFromEnumType when sorting by enum order is required. FillComboItemsFromEnumType preserves EnumValueDescription display through WPF's automatic ToString() calling on enum Content, and provides built-in sorting functionality via SortDescriptions.Add("text", Ascending). This was confirmed by AmanPrasad43 in PR #4286 for the ZAP vulnerability type dropdown.

Applied to files:

  • Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs
🧬 Code graph analysis (4)
Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs (2)
Ginger/GingerCore/Actions/UIAutomation/UIAComWrapperHelper.cs (17)
  • System (567-590)
  • System (6880-6891)
  • UIAuto (371-399)
  • UIAuto (696-713)
  • UIAuto (715-737)
  • UIAuto (739-771)
  • UIAuto (831-848)
  • UIAuto (1010-1039)
  • UIAuto (1110-1145)
  • UIAuto (1215-1384)
  • UIAuto (1387-1391)
  • UIAuto (1491-1510)
  • UIAuto (1532-1578)
  • UIAuto (1580-1616)
  • UIAuto (1618-1644)
  • UIAuto (3027-3038)
  • UIAuto (3637-3667)
Ginger/GingerCoreCommon/Actions/UI Element/ActUIElement.cs (2)
  • ActUIElement (33-1073)
  • Fields (71-147)
Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverBase.cs (1)
Ginger/GingerCore/Actions/ActConsoleCommand.cs (2)
  • ActConsoleCommand (30-132)
  • CommandValueAttribute (139-142)
Ginger/GingerCore/Drivers/Common/UIElementOperationsHelper.cs (2)
Ginger/GingerCore/Actions/UIAutomation/WinAPIAutomation.cs (1)
  • DoubleSendClick (386-403)
Ginger/GingerCoreCommon/ReporterLib/Reporter.cs (1)
  • Reporter (28-357)
Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs (3)
Ginger/GingerCore/Actions/ActConsoleCommand.cs (2)
  • ActConsoleCommand (30-132)
  • Fields (116-127)
Ginger/GingerCore/GeneralLib/General.cs (1)
  • FillComboFromEnumObj (147-210)
Ginger/GingerCore/GeneralLib/InputBoxWindow.xaml.cs (1)
  • ObjFieldBinding (147-157)
🔇 Additional comments (9)
Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs (2)

421-426: LGTM! Double-click actions properly integrated

The new DoubleClick and MouseDoubleClick actions are correctly wired to their respective helper methods, following the existing pattern for click actions.


609-670: Excellent implementation of GetCoOrdinate with robust fallbacks!

The implementation correctly:

  • Returns element-relative coordinates (not absolute)
  • Guards against zero-size bounding rectangles
  • Handles parse failures gracefully
  • Provides sensible defaults

This properly fixes the double-offset issue that was previously identified.

Ginger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverBase.cs (2)

123-137: LGTM! Thread-safe caching with proper null checks

The implementation correctly uses ConcurrentDictionary for thread-safe caching and includes proper null/empty checks for the members array, addressing the performance and robustness concerns from the previous review.


177-188: Well-structured platform-specific command terminator logic

The implementation correctly handles:

  • Unix: Appends terminator directly
  • DOS with Enter: Adds \r before the newline for proper Windows line ending
  • Other cases: Appends terminator as-is

This ensures commands are properly terminated across different platforms.

Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.cs (2)

63-64: LGTM! Proper binding implementation

The code correctly uses data binding with SelectedValueProperty instead of parsing SelectedItem.ToString(), which was identified as brittle in the previous review.


130-136: LGTM! Type-safe value retrieval

The SelectionChanged handler properly checks the type and retrieves the strongly-typed value from SelectedValue, avoiding fragile string parsing.

Ginger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml (1)

38-42: LGTM! XAML properly formatted with escaped quotes

The tooltip text correctly uses &quot; for quotes instead of raw " characters, preventing XAML parser errors. The layout is clean with the new command terminator controls properly integrated.

Ginger/GingerCore/Actions/ActConsoleCommand.cs (2)

19-27: Imports look correct for new attributes.

EnumValueDescription and default handling need these namespaces. No issues.


70-85: Enter maps to "\n" — verify CRLF handling on Windows.

Many Windows shells expect CRLF for Enter. If the driver does not translate "\n" to "\r\n" on DOS/Windows, Enter may not execute commands. Confirm ConsoleDriver path normalizes per platform; otherwise consider mapping via driver instead of fixed literal here.

Comment thread Ginger/GingerCore/Actions/ActConsoleCommand.cs
coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 19, 2025

@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 b54a88e and 20441fa.

📒 Files selected for processing (1)
  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs (4 hunks)
🧰 Additional context used
🧠 Learnings (7)
📚 Learning: 2025-09-04T15:43:57.789Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:9146-9291
Timestamp: 2025-09-04T15:43:57.789Z
Learning: In SeleniumDriver.cs, prefer using the C# fallback GenerateEnhancedSvgXPath(IWebElement) for SVG XPath generation instead of injecting/validating a JavaScript-based XPath builder. This was accepted in PR Ginger-Automation/Ginger#4294.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-09-04T16:40:09.511Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:6019-6061
Timestamp: 2025-09-04T16:40:09.511Z
Learning: In Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (AddSvgSpecificLocators, around lines ~6000–6065) for PR Ginger-Automation/Ginger#4294, maintainer prashelke indicated that adjusting XPath to remove outer quotes around EscapeXPathString(...) is not required. Do not suggest changing the quoting around EscapeXPathString for SVG-specific locators in future reviews unless maintainers request it.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-07-10T07:11:28.974Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4249
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:4684-4695
Timestamp: 2025-07-10T07:11:28.974Z
Learning: In Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs, attribute values used in CSS selectors (e.g., ByTitle, ByAriaLabel, ByDataTestId, ByPlaceholder) should be escaped using a helper method (such as EscapeCssAttributeValue) to prevent selector breakage due to special characters.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-09-04T16:40:33.092Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:9182-9223
Timestamp: 2025-09-04T16:40:33.092Z
Learning: In PR Ginger-Automation/Ginger#4294 (SeleniumDriver.cs GenerateSvgAttributeBasedXPath), maintainer declined changing XPath to remove extra quotes around EscapeXPathString(...) results; keep current quoting as-is in this area for now.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-09-04T15:42:00.330Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:8334-8350
Timestamp: 2025-09-04T15:42:00.330Z
Learning: In PR Ginger-Automation/Ginger#4294, SeleniumDriver.cs: maintainer requested to keep the WebElement-based helper IsSvgElementByWebElement(IWebElement) and its current usages for now, deferring the replacement with GetElementTypeEnum(..) + IsSvgElement(eElementType) to a later PR.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-09-04T09:55:20.543Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4294
File: Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs:5789-5796
Timestamp: 2025-09-04T09:55:20.543Z
Learning: In Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs (around line 5786), maintainer prashelke prefers to keep the helper method `IsSvgElement(eElementType)` as-is (no inlining or renaming), even though it currently checks only for `eElementType.Svg`. Future reviews should not suggest removing or renaming this helper.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
📚 Learning: 2025-06-16T10:37:13.073Z
Learnt from: prashelke
PR: Ginger-Automation/Ginger#4232
File: Ginger/GingerCoreNET/ActionsLib/UI/VisualTesting/VRTAnalyzer.cs:19-22
Timestamp: 2025-06-16T10:37:13.073Z
Learning: In Ginger codebase, both `using amdocs.ginger.GingerCoreNET;` and `using Amdocs.Ginger.CoreNET;` are valid and serve different purposes. The first (lowercase) contains the WorkSpace class and related workspace functionality, while the second (proper case) contains drivers like GenericAppiumDriver and other core functionality. Both may be required in files that use types from both namespaces.

Applied to files:

  • Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs
🧬 Code graph analysis (1)
Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs (2)
Ginger/GingerCore/Actions/UIAutomation/UIAComWrapperHelper.cs (17)
  • System (567-590)
  • System (6880-6891)
  • UIAuto (371-399)
  • UIAuto (696-713)
  • UIAuto (715-737)
  • UIAuto (739-771)
  • UIAuto (831-848)
  • UIAuto (1010-1039)
  • UIAuto (1110-1145)
  • UIAuto (1215-1384)
  • UIAuto (1387-1391)
  • UIAuto (1491-1510)
  • UIAuto (1532-1578)
  • UIAuto (1580-1616)
  • UIAuto (1618-1644)
  • UIAuto (3027-3038)
  • UIAuto (3637-3667)
Ginger/GingerCoreCommon/Actions/UI Element/ActUIElement.cs (2)
  • ActUIElement (33-1073)
  • Fields (71-147)
🔇 Additional comments (4)
Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs (4)

44-45: LGTM! Consistent UIAutomation integration.

The using directive for System.Windows.Automation with the UIAuto alias follows the established pattern in the codebase and provides proper access to UI automation functionality needed for the double-click features.


421-426: LGTM! Clean integration of double-click actions.

The new DoubleClick and MouseDoubleClick actions are properly integrated with the mUIElementOperationsHelper, following the same pattern as existing click actions. This maintains consistency with the existing codebase architecture.


436-436: LGTM! Improved coordinate handling with centralized logic.

The refactored XY-based actions now use the centralized GetCoOrdinate helper method, which provides better error handling and consistent coordinate calculation across all XY operations.

Also applies to: 443-443, 448-448


609-665: LGTM! Excellent coordinate calculation implementation.

The GetCoOrdinate method addresses all the issues from previous reviews with a robust implementation:

Returns element-relative coordinates: Uses only Width/2 and Height/2 without adding Left/Top
Robust input parsing: Uses int.TryParse instead of exception-prone Int32.Parse
Zero-size protection: Guards against width/height ≤ 0 with fallback to (5,5) defaults
Exception handling: Graceful fallback for bounding rectangle read failures
Comprehensive logic: Handles all scenarios (missing X, missing Y, unparseable values)

This implementation will prevent the double-offset clicks and ensure reliable positioning for ClickXY/DoubleClickXY/RightClickXY actions.

Comment thread Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 19, 2025
@Maheshkale447
Maheshkale447 merged commit ea4a692 into master Sep 19, 2025
18 of 23 checks passed
@Maheshkale447
Maheshkale447 deleted the BugFix/UnixConsoleActionEnhacement branch September 19, 2025 11:05
@coderabbitai coderabbitai Bot mentioned this pull request Nov 11, 2025
15 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Nov 19, 2025
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