From 8de9bccde70cc63d0d846afffcee5d4a9b2fb46f Mon Sep 17 00:00:00 2001 From: Gokul Bothe Date: Tue, 16 Jul 2024 18:44:29 +0530 Subject: [PATCH 1/3] Remote web Driver Agent Page not showing --- Ginger/Ginger/Agents/AgentEditPage.xaml.cs | 11 +----- .../WebAgentConfigEditPage.xaml | 8 +--- .../WebAgentConfigEditPage.xaml.cs | 37 +++++++++---------- .../Web/Selenium/SeleniumDriver.cs | 4 ++ 4 files changed, 25 insertions(+), 35 deletions(-) diff --git a/Ginger/Ginger/Agents/AgentEditPage.xaml.cs b/Ginger/Ginger/Agents/AgentEditPage.xaml.cs index 9f1f54ae80..cd56d380d9 100644 --- a/Ginger/Ginger/Agents/AgentEditPage.xaml.cs +++ b/Ginger/Ginger/Agents/AgentEditPage.xaml.cs @@ -110,16 +110,7 @@ public AgentEditPage(Agent agent, bool isReadOnly = false, bool ignoreValidation } if (mAgent.AgentType == eAgentType.Driver) { - if (mAgent.DriverType == eDriverType.Selenium) - { - xAgentConfigFrame.SetContent(new WebAgentConfigEditPage(mAgent)); - } - else - { - xAgentConfigFrame.SetContent(new AgentDriverConfigPage(mAgent, _viewMode)); - } - - + xAgentConfigFrame.SetContent(new AgentDriverConfigPage(mAgent, _viewMode)); } else { diff --git a/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml b/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml index 026263833c..9b6fb05f8b 100644 --- a/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml +++ b/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml @@ -11,9 +11,7 @@ - - - + @@ -300,8 +298,6 @@ - - - + diff --git a/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml.cs b/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml.cs index 53cdb2ce98..4150e0eb3a 100644 --- a/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml.cs +++ b/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml.cs @@ -56,7 +56,7 @@ public WebAgentConfigEditPage(Agent mAgent) this.mAgent = mAgent; InitializeComponent(); - bindElement(); + BindElement(); DriverConfigParam? browserTypeParam = mAgent.DriverConfiguration.FirstOrDefault(p => string.Equals(p.Parameter, nameof(GingerWebDriver.BrowserType))); if (browserTypeParam != null) @@ -64,17 +64,17 @@ public WebAgentConfigEditPage(Agent mAgent) browserTypeParam.PropertyChanged += BrowserTypeParam_PropertyChanged; } WebBrowserType browserType = Enum.Parse(browserTypeParam?.Value); - edgeIEPnlVisibility(browserType); - chromePnlvisibilitly(browserType); - chromeFirefoxPnlVisibility(browserType); - allBrowserNotBravePnl(browserType); - proxyPnlVisbility(); + EdgeIEPnlVisibility(browserType); + ChromePnlvisibilitly(browserType); + ChromeFirefoxPnlVisibility(browserType); + AllBrowserNotBravePnl(browserType); + ProxyPnlVisbility(); } /// /// Binds the elements of the page. /// - void bindElement() + void BindElement() { #region ProxyConfigration @@ -288,8 +288,7 @@ void bindElement() if (!string.IsNullOrEmpty(proxyName.Value)) { - autoDetect.Value = "False"; - BindingHandler.ObjFieldBinding(xAutoDetectProxyCB, CheckBox.IsCheckedProperty, autoDetect, nameof(DriverConfigParam.Value)); + xAutoDetectProxyCB.IsChecked= false; } } @@ -316,17 +315,17 @@ private void BrowserTypeParam_PropertyChanged(object? sender, PropertyChangedEve } WebBrowserType browserType = Enum.Parse(driverConfigParam.Value); - edgeIEPnlVisibility(browserType); - chromePnlvisibilitly(browserType); - chromeFirefoxPnlVisibility(browserType); - allBrowserNotBravePnl(browserType); + EdgeIEPnlVisibility(browserType); + ChromePnlvisibilitly(browserType); + ChromeFirefoxPnlVisibility(browserType); + AllBrowserNotBravePnl(browserType); } /// /// Sets the visibility of the Edge/IE panel based on the specified browser type. /// /// The browser type. - void allBrowserNotBravePnl(WebBrowserType result) + void AllBrowserNotBravePnl(WebBrowserType result) { @@ -346,7 +345,7 @@ void allBrowserNotBravePnl(WebBrowserType result) /// Sets the visibility of the Edge/IE panel based on the specified browser type. /// /// The browser type. - void edgeIEPnlVisibility(WebBrowserType result) + void EdgeIEPnlVisibility(WebBrowserType result) { @@ -365,7 +364,7 @@ void edgeIEPnlVisibility(WebBrowserType result) /// Sets the visibility of the Chrome panel based on the specified browser type. /// /// The browser type. - void chromePnlvisibilitly(WebBrowserType result) + void ChromePnlvisibilitly(WebBrowserType result) { if (result == WebBrowserType.Chrome|| result==WebBrowserType.Brave) { @@ -382,7 +381,7 @@ void chromePnlvisibilitly(WebBrowserType result) /// Sets the visibility of the Chrome/Firefox panel based on the specified browser type. /// /// The browser type. - void chromeFirefoxPnlVisibility(WebBrowserType result) + void ChromeFirefoxPnlVisibility(WebBrowserType result) { if (result == WebBrowserType.Chrome || result == WebBrowserType.FireFox || result == WebBrowserType.Brave) { @@ -398,7 +397,7 @@ void chromeFirefoxPnlVisibility(WebBrowserType result) /// /// The browser type. - void proxyPnlVisbility() + void ProxyPnlVisbility() { if (xAutoDetectProxyCB.IsChecked == false) { @@ -412,7 +411,7 @@ void proxyPnlVisbility() } private void xAutoDetectProxyCB_Click(object sender, RoutedEventArgs e) { - proxyPnlVisbility(); + ProxyPnlVisbility(); xProxyVE.ValueTextBox.Text = ""; } } diff --git a/Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs b/Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs index 53393d363b..0089acecb1 100644 --- a/Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs +++ b/Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs @@ -167,6 +167,10 @@ public override string GetDriverConfigsEditPageName(Agent.eDriverType driverSubT { return "SeleniumRemoteWebDriverEditPage"; } + else if (browserType == WebBrowserType.Chrome|| browserType == WebBrowserType.Brave || browserType == WebBrowserType.Edge || browserType == WebBrowserType.InternetExplorer || browserType == WebBrowserType.FireFox ) + { + return "WebAgentConfigEditPage"; + } else { return null; From 03516289606ea56c5b4052d6459fb8e4696a7b6f Mon Sep 17 00:00:00 2001 From: Gokul Bothe Date: Tue, 16 Jul 2024 18:44:29 +0530 Subject: [PATCH 2/3] Remote web Driver Agent Page not showing --- Ginger/Ginger/Agents/AgentEditPage.xaml.cs | 11 +----- .../WebAgentConfigEditPage.xaml | 8 +--- .../WebAgentConfigEditPage.xaml.cs | 37 +++++++++---------- .../Web/Selenium/SeleniumDriver.cs | 4 ++ 4 files changed, 25 insertions(+), 35 deletions(-) diff --git a/Ginger/Ginger/Agents/AgentEditPage.xaml.cs b/Ginger/Ginger/Agents/AgentEditPage.xaml.cs index 9f1f54ae80..cd56d380d9 100644 --- a/Ginger/Ginger/Agents/AgentEditPage.xaml.cs +++ b/Ginger/Ginger/Agents/AgentEditPage.xaml.cs @@ -110,16 +110,7 @@ public AgentEditPage(Agent agent, bool isReadOnly = false, bool ignoreValidation } if (mAgent.AgentType == eAgentType.Driver) { - if (mAgent.DriverType == eDriverType.Selenium) - { - xAgentConfigFrame.SetContent(new WebAgentConfigEditPage(mAgent)); - } - else - { - xAgentConfigFrame.SetContent(new AgentDriverConfigPage(mAgent, _viewMode)); - } - - + xAgentConfigFrame.SetContent(new AgentDriverConfigPage(mAgent, _viewMode)); } else { diff --git a/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml b/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml index 026263833c..9b6fb05f8b 100644 --- a/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml +++ b/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml @@ -11,9 +11,7 @@ - - - + @@ -300,8 +298,6 @@ - - - + diff --git a/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml.cs b/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml.cs index 53cdb2ce98..4150e0eb3a 100644 --- a/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml.cs +++ b/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml.cs @@ -56,7 +56,7 @@ public WebAgentConfigEditPage(Agent mAgent) this.mAgent = mAgent; InitializeComponent(); - bindElement(); + BindElement(); DriverConfigParam? browserTypeParam = mAgent.DriverConfiguration.FirstOrDefault(p => string.Equals(p.Parameter, nameof(GingerWebDriver.BrowserType))); if (browserTypeParam != null) @@ -64,17 +64,17 @@ public WebAgentConfigEditPage(Agent mAgent) browserTypeParam.PropertyChanged += BrowserTypeParam_PropertyChanged; } WebBrowserType browserType = Enum.Parse(browserTypeParam?.Value); - edgeIEPnlVisibility(browserType); - chromePnlvisibilitly(browserType); - chromeFirefoxPnlVisibility(browserType); - allBrowserNotBravePnl(browserType); - proxyPnlVisbility(); + EdgeIEPnlVisibility(browserType); + ChromePnlvisibilitly(browserType); + ChromeFirefoxPnlVisibility(browserType); + AllBrowserNotBravePnl(browserType); + ProxyPnlVisbility(); } /// /// Binds the elements of the page. /// - void bindElement() + void BindElement() { #region ProxyConfigration @@ -288,8 +288,7 @@ void bindElement() if (!string.IsNullOrEmpty(proxyName.Value)) { - autoDetect.Value = "False"; - BindingHandler.ObjFieldBinding(xAutoDetectProxyCB, CheckBox.IsCheckedProperty, autoDetect, nameof(DriverConfigParam.Value)); + xAutoDetectProxyCB.IsChecked= false; } } @@ -316,17 +315,17 @@ private void BrowserTypeParam_PropertyChanged(object? sender, PropertyChangedEve } WebBrowserType browserType = Enum.Parse(driverConfigParam.Value); - edgeIEPnlVisibility(browserType); - chromePnlvisibilitly(browserType); - chromeFirefoxPnlVisibility(browserType); - allBrowserNotBravePnl(browserType); + EdgeIEPnlVisibility(browserType); + ChromePnlvisibilitly(browserType); + ChromeFirefoxPnlVisibility(browserType); + AllBrowserNotBravePnl(browserType); } /// /// Sets the visibility of the Edge/IE panel based on the specified browser type. /// /// The browser type. - void allBrowserNotBravePnl(WebBrowserType result) + void AllBrowserNotBravePnl(WebBrowserType result) { @@ -346,7 +345,7 @@ void allBrowserNotBravePnl(WebBrowserType result) /// Sets the visibility of the Edge/IE panel based on the specified browser type. /// /// The browser type. - void edgeIEPnlVisibility(WebBrowserType result) + void EdgeIEPnlVisibility(WebBrowserType result) { @@ -365,7 +364,7 @@ void edgeIEPnlVisibility(WebBrowserType result) /// Sets the visibility of the Chrome panel based on the specified browser type. /// /// The browser type. - void chromePnlvisibilitly(WebBrowserType result) + void ChromePnlvisibilitly(WebBrowserType result) { if (result == WebBrowserType.Chrome|| result==WebBrowserType.Brave) { @@ -382,7 +381,7 @@ void chromePnlvisibilitly(WebBrowserType result) /// Sets the visibility of the Chrome/Firefox panel based on the specified browser type. /// /// The browser type. - void chromeFirefoxPnlVisibility(WebBrowserType result) + void ChromeFirefoxPnlVisibility(WebBrowserType result) { if (result == WebBrowserType.Chrome || result == WebBrowserType.FireFox || result == WebBrowserType.Brave) { @@ -398,7 +397,7 @@ void chromeFirefoxPnlVisibility(WebBrowserType result) /// /// The browser type. - void proxyPnlVisbility() + void ProxyPnlVisbility() { if (xAutoDetectProxyCB.IsChecked == false) { @@ -412,7 +411,7 @@ void proxyPnlVisbility() } private void xAutoDetectProxyCB_Click(object sender, RoutedEventArgs e) { - proxyPnlVisbility(); + ProxyPnlVisbility(); xProxyVE.ValueTextBox.Text = ""; } } diff --git a/Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs b/Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs index 53393d363b..0089acecb1 100644 --- a/Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs +++ b/Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs @@ -167,6 +167,10 @@ public override string GetDriverConfigsEditPageName(Agent.eDriverType driverSubT { return "SeleniumRemoteWebDriverEditPage"; } + else if (browserType == WebBrowserType.Chrome|| browserType == WebBrowserType.Brave || browserType == WebBrowserType.Edge || browserType == WebBrowserType.InternetExplorer || browserType == WebBrowserType.FireFox ) + { + return "WebAgentConfigEditPage"; + } else { return null; From 546607b46b6d850db47b85169685cd1890a34637 Mon Sep 17 00:00:00 2001 From: Gokul Bothe Date: Thu, 18 Jul 2024 14:28:04 +0530 Subject: [PATCH 3/3] handled the changes of 39660 --- .../WebAgentConfigEditPage.xaml | 71 +++++++++---------- .../WebAgentConfigEditPage.xaml.cs | 2 +- .../Web/Selenium/SeleniumDriver.cs | 34 ++++++--- 3 files changed, 59 insertions(+), 48 deletions(-) diff --git a/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml b/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml index 9b6fb05f8b..cdc5364cc3 100644 --- a/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml +++ b/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml @@ -106,8 +106,22 @@ - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + @@ -229,8 +221,21 @@ + + - + + + + + + + + + + + + @@ -272,19 +277,7 @@ - - - - - - - - - - - - - + diff --git a/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml.cs b/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml.cs index 4150e0eb3a..eb1493b27e 100644 --- a/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml.cs +++ b/Ginger/Ginger/Drivers/DriversConfigsEditPages/WebAgentConfigEditPage.xaml.cs @@ -246,7 +246,7 @@ void BindElement() BindingHandler.ObjFieldBinding(xStartBMPPortVE, TextBox.ToolTipProperty, startBMPPort, nameof(DriverConfigParam.Description)); //Unhandled promt Behavior - GingerCore.General.FillComboFromEnumType(xUnhandledPromptBehaviorComboBox, typeof(SeleniumDriver.eUnhandledPromptBehavior)); + GingerCore.General.FillComboFromEnumObj(xUnhandledPromptBehaviorComboBox, new SeleniumDriver().UnhandledPromptBehavior1); DriverConfigParam UnhandledPromptBehavior = mAgent.GetOrCreateParam(nameof(SeleniumDriver.UnhandledPromptBehavior)); BindingHandler.ObjFieldBinding(xUnhandledPromptBehaviorComboBox, ComboBox.SelectedValueProperty, UnhandledPromptBehavior, nameof(DriverConfigParam.Value)); BindingHandler.ObjFieldBinding(xUnhandledPromptBehaviorComboBox, ComboBox.ToolTipProperty, UnhandledPromptBehavior, nameof(DriverConfigParam.Description)); diff --git a/Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs b/Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs index 0089acecb1..949ef52cc4 100644 --- a/Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs +++ b/Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs @@ -127,18 +127,36 @@ public enum ePageLoadStrategy Normal, Eager , None, - } - + } public enum eUnhandledPromptBehavior { - Default, - Ignore, - Accept, - Dismiss, - AcceptAndNotify, + [EnumValueDescription("Default")] + Default, + [EnumValueDescription("Ignore")] + Ignore, + [EnumValueDescription("Accept")] + Accept, + [EnumValueDescription("Dismiss")] + Dismiss, + [EnumValueDescription("Accept And Notify")] + AcceptAndNotify, + [EnumValueDescription("Dismiss And Notify")] DismissAndNotify } + eUnhandledPromptBehavior mUnhandledPromptBehavior; + public eUnhandledPromptBehavior UnhandledPromptBehavior1 + { + get { return mUnhandledPromptBehavior; } + set + { + if (mUnhandledPromptBehavior != value) + { + mUnhandledPromptBehavior = value; + + } + } + } public enum eBrowserLogLevel { @@ -272,7 +290,7 @@ public override string GetDriverConfigsEditPageName(Agent.eDriverType driverSubT [UserConfigured] [UserConfiguredDefault("")] - [UserConfiguredDescription("Only for Chrome, Firefox & Edge | Full path for the User Profile folder")] + [UserConfiguredDescription("Only for Chrome, Firefox, Edge and Brave | Full path for the User Profile folder")] public string UserProfileFolderPath { get; set; } [UserConfigured]