Updated Unix Console action and Double click for Windows enhancement#4305
Conversation
WalkthroughAdds 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
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
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
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (7)📚 Learning: 2025-09-04T15:43:57.789ZApplied to files:
📚 Learning: 2025-09-04T16:40:09.511ZApplied to files:
📚 Learning: 2025-07-10T07:11:28.974ZApplied to files:
📚 Learning: 2025-09-04T16:40:33.092ZApplied to files:
📚 Learning: 2025-09-04T15:42:00.330ZApplied to files:
📚 Learning: 2025-09-04T09:55:20.543ZApplied to files:
📚 Learning: 2025-06-16T10:37:13.073ZApplied to files:
🧬 Code graph analysis (1)Ginger/GingerCore/Drivers/WindowsLib/WindowsDriver.cs (3)
🔇 Additional comments (4)
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. Comment |
There was a problem hiding this comment.
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 parityAdding 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 switchDoubleClick 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 commandYou 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 sendsVerified: 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
📒 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.csGinger/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.csGinger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.csGinger/GingerCore/Drivers/WindowsLib/WindowsDriver.csGinger/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.csGinger/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.csGinger/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.csGinger/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 wiringEnum 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: OKChange 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: OKRouting to mUIElementOperationsHelper is aligned with the platform changes.
Ginger/GingerCore/Actions/ActConsoleCommand.cs (1)
133-142: Attribute implementation fine; no issuesCommandValueAttribute is minimal and correct for the reflection use in the driver.
There was a problem hiding this comment.
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 redundantSelectedValue 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 handlerTwo-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
📒 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.csGinger/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.csGinger/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.csGinger/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.xamlGinger/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.xamlGinger/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.csGinger/Ginger/Actions/ActionEditPages/ActConsoleCommandEditPage.xaml.csGinger/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 wiredSwitch cases delegate to helper methods as expected. No issues.
435-450: XY actions now use centralized, element-relative coordinate resolver — goodRouting 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 correctSequence is robust and logs are appropriate.
370-384: MouseDoubleClickElement implementation looks goodDirect WinAPI double-click with clear success/error messages.
Ginger/GingerCore/Actions/ActConsoleCommand.cs (3)
70-85: Enum mapping looks solidClear value-to-display mapping; “None” for Empty improves UX.
105-106: Default/back-compat: confirm deserialization behaviorYou 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 fineUsing the nested enum via static import keeps call sites clean.
123-134: Robust, cached attribute lookupThread-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 newlineCurrent 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 fineAdds required namespace for ImageMakerControl.
There was a problem hiding this comment.
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 100msThe 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.DoubleClickTimelimitations, you could use:- Thread.Sleep(100); + Thread.Sleep(500); // Use Windows default double-click timeOr 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 messageLine 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 messageLine 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
📒 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.csGinger/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.csGinger/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.csGinger/GingerCore/Drivers/ConsoleDriverLib/ConsoleDriverBase.csGinger/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.csGinger/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.csGinger/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.csGinger/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 integratedThe 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 checksThe 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 logicThe implementation correctly handles:
- Unix: Appends terminator directly
- DOS with Enter: Adds
\rbefore 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 implementationThe code correctly uses data binding with
SelectedValuePropertyinstead of parsingSelectedItem.ToString(), which was identified as brittle in the previous review.
130-136: LGTM! Type-safe value retrievalThe 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 quotesThe tooltip text correctly uses
"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.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (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
GetCoOrdinatehelper 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
GetCoOrdinatemethod addresses all the issues from previous reviews with a robust implementation:✅ Returns element-relative coordinates: Uses only
Width/2andHeight/2without addingLeft/Top
✅ Robust input parsing: Usesint.TryParseinstead of exception-proneInt32.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.
Thank you for your contribution.
Before submitting this PR, please make sure:
Summary by CodeRabbit
New Features
Bug Fixes