diff --git a/Ginger/Ginger/Drivers/DriversConfigsEditPages/SeleniumRemoteWebDriverEditPage.xaml.cs b/Ginger/Ginger/Drivers/DriversConfigsEditPages/SeleniumRemoteWebDriverEditPage.xaml.cs index 193404a46..28f15b33b 100644 --- a/Ginger/Ginger/Drivers/DriversConfigsEditPages/SeleniumRemoteWebDriverEditPage.xaml.cs +++ b/Ginger/Ginger/Drivers/DriversConfigsEditPages/SeleniumRemoteWebDriverEditPage.xaml.cs @@ -26,6 +26,7 @@ limitations under the License. using System.IO; using System.IO.Compression; using System.Net; +using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; @@ -159,7 +160,7 @@ private void GetHubFilesButton_Click(object sender, RoutedEventArgs e) Process.Start(new System.Diagnostics.ProcessStartInfo() { FileName = targetZipPath, UseShellExecute = true }); } - private void GetNodeFilesButton_Click(object sender, RoutedEventArgs e) + private async void GetNodeFilesButton_Click(object sender, RoutedEventArgs e) { //Getting the Ginger execution path string? assemblyLocation = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); @@ -192,7 +193,7 @@ private void GetNodeFilesButton_Click(object sender, RoutedEventArgs e) { BrowserType = WebBrowserType.Chrome }; - string chromeSourceFile = seleniumDriver.GetDriverPath(SeleniumDriver.eBrowserType.Chrome); + string chromeSourceFile = await seleniumDriver.GetDriverPath(SeleniumDriver.eBrowserType.Chrome); string chromeDestFile = System.IO.Path.Combine(targetPath, chromeDriverFile); if (!System.IO.File.Exists(chromeDestFile)) @@ -208,7 +209,7 @@ private void GetNodeFilesButton_Click(object sender, RoutedEventArgs e) } seleniumDriver.BrowserType = WebBrowserType.FireFox; - string fireFoxSourceFile = seleniumDriver.GetDriverPath(SeleniumDriver.eBrowserType.FireFox); + string fireFoxSourceFile = await seleniumDriver.GetDriverPath(SeleniumDriver.eBrowserType.FireFox); string fireFoxDestFile = System.IO.Path.Combine(targetPath, fireFoxDriverFile); if (!System.IO.File.Exists(fireFoxDestFile)) @@ -224,7 +225,7 @@ private void GetNodeFilesButton_Click(object sender, RoutedEventArgs e) } } seleniumDriver.BrowserType = WebBrowserType.InternetExplorer; - string IESourceFile = seleniumDriver.GetDriverPath(SeleniumDriver.eBrowserType.IE); + string IESourceFile = await seleniumDriver.GetDriverPath(SeleniumDriver.eBrowserType.IE); string IEDestFile = System.IO.Path.Combine(targetPath, IEDriverFile); if (!System.IO.File.Exists(IEDestFile)) @@ -239,7 +240,7 @@ private void GetNodeFilesButton_Click(object sender, RoutedEventArgs e) } } seleniumDriver.BrowserType = WebBrowserType.Edge; - string edgeSourceFile = seleniumDriver.GetDriverPath(SeleniumDriver.eBrowserType.Edge); + string edgeSourceFile = await seleniumDriver.GetDriverPath(SeleniumDriver.eBrowserType.Edge); string edgeDestFile = System.IO.Path.Combine(targetPath, EdgeDriverFile); if (!System.IO.File.Exists(edgeDestFile)) diff --git a/Ginger/GingerCoreCommonTest/Repository/SolutionRepositoryMultiThreadTest.cs b/Ginger/GingerCoreCommonTest/Repository/SolutionRepositoryMultiThreadTest.cs index c1e3df50e..062c9baa2 100644 --- a/Ginger/GingerCoreCommonTest/Repository/SolutionRepositoryMultiThreadTest.cs +++ b/Ginger/GingerCoreCommonTest/Repository/SolutionRepositoryMultiThreadTest.cs @@ -154,6 +154,9 @@ public void zz() ObservableList allMRIs = mSolutionRepository.GetAllRepositoryItems(); t1Count = allMRIs.Count; + + //Assert + Assert.AreEqual(106, t1Count); } // run two threads which does GetAllitems diff --git a/Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs b/Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs index d0166f600..47e90b0f0 100644 --- a/Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs +++ b/Ginger/GingerCoreNET/Drivers/CoreDrivers/Web/Selenium/SeleniumDriver.cs @@ -75,8 +75,8 @@ limitations under the License. using System.Threading; using System.Threading.Tasks; using static GingerCoreNET.GeneralLib.General; -using DevToolsDomains = OpenQA.Selenium.DevTools.V139.DevToolsSessionDomains; -using DevToolsVersion = OpenQA.Selenium.DevTools.V139; +using DevToolsDomains = OpenQA.Selenium.DevTools.V145.DevToolsSessionDomains; +using DevToolsVersion = OpenQA.Selenium.DevTools.V145; @@ -603,7 +603,7 @@ public override void StartDriver() { Kind = ProxyKind.Manual, HttpProxy = Proxy, - FtpProxy = Proxy, + //FtpProxy = Proxy, SslProxy = Proxy, SocksProxy = Proxy, SocksVersion = 5 @@ -664,7 +664,7 @@ public override void StartDriver() } mProxy.Kind = ProxyKind.Manual; mProxy.HttpProxy = Proxy; - mProxy.FtpProxy = Proxy; + //mProxy.FtpProxy = Proxy; mProxy.SslProxy = Proxy; mProxy.SocksProxy = Proxy; @@ -1160,7 +1160,7 @@ public override void StartDriver() ex.Message.StartsWith("error starting process", StringComparison.InvariantCultureIgnoreCase))) { RestartRetry = false; - UpdateDriver(mBrowserType); + UpdateDriver(mBrowserType).ConfigureAwait(true); StartDriver(); } } @@ -1319,7 +1319,7 @@ private static bool GetIsRunningInDocker() return env == "docker"; } - private string UpdateDriver(eBrowserType browserType) + private async Task UpdateDriver(eBrowserType browserType) { try { @@ -1364,7 +1364,7 @@ private string UpdateDriver(eBrowserType browserType) SetBrowserVersion(driverOptions); var driverFinder = new DriverFinder(driverOptions); - var driverpath = driverFinder.GetDriverPath(); + var driverpath = await driverFinder.GetDriverPathAsync(); Reporter.ToLog(eLogLevel.INFO, $"Updated {browserType} driver to latest and placed in {driverpath}."); return driverpath; } @@ -1379,10 +1379,9 @@ private string UpdateDriver(eBrowserType browserType) } } - public string GetDriverPath(eBrowserType browserType) + public async Task GetDriverPath(eBrowserType browserType) { - string DriverPath = string.Empty; - DriverPath = UpdateDriver(browserType); + string DriverPath = await UpdateDriver(browserType); return DriverPath; } private static void CloseDriverProcess(DriverService driverService) diff --git a/Ginger/GingerCoreNET/GeneralLib/GingerPlayUtils.cs b/Ginger/GingerCoreNET/GeneralLib/GingerPlayUtils.cs index 1d597e254..848cc5496 100644 --- a/Ginger/GingerCoreNET/GeneralLib/GingerPlayUtils.cs +++ b/Ginger/GingerCoreNET/GeneralLib/GingerPlayUtils.cs @@ -20,7 +20,6 @@ limitations under the License. using Amdocs.Ginger.Common; using Amdocs.Ginger.Common.External.Configurations; using Amdocs.Ginger.CoreNET.External.GingerPlay; -using OpenQA.Selenium.DevTools.V137.Audits; using System; namespace GingerCoreNET.GeneralLib diff --git a/Ginger/GingerCoreNET/GingerCoreNET.csproj b/Ginger/GingerCoreNET/GingerCoreNET.csproj index 93a4f8282..fce4a88e0 100644 --- a/Ginger/GingerCoreNET/GingerCoreNET.csproj +++ b/Ginger/GingerCoreNET/GingerCoreNET.csproj @@ -332,8 +332,8 @@ - - + + diff --git a/Ginger/GingerCoreNETUnitTest/SeleniumDriverTest/GetDriverPathTest.cs b/Ginger/GingerCoreNETUnitTest/SeleniumDriverTest/GetDriverPathTest.cs index 1d8cac9f3..3debdfe5b 100644 --- a/Ginger/GingerCoreNETUnitTest/SeleniumDriverTest/GetDriverPathTest.cs +++ b/Ginger/GingerCoreNETUnitTest/SeleniumDriverTest/GetDriverPathTest.cs @@ -19,6 +19,7 @@ limitations under the License. using GingerCore.Drivers; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.IO; +using System.Threading.Tasks; namespace GingerCoreNETUnitTest.SeleniumDriverTest { @@ -34,25 +35,25 @@ public void TestInitialize() } [TestMethod] - public void GetchromeDriverPath() + public async Task GetchromeDriverPath() { - string DriverPath = driver.GetDriverPath(SeleniumDriver.eBrowserType.Chrome); + string DriverPath = await driver.GetDriverPath(SeleniumDriver.eBrowserType.Chrome); bool v = File.Exists(DriverPath); Assert.AreEqual(true, v); } [TestMethod] - public void GetFirfoxDriverPath() + public async Task GetFirfoxDriverPath() { - string DriverPath = driver.GetDriverPath(SeleniumDriver.eBrowserType.FireFox); + string DriverPath = await driver.GetDriverPath(SeleniumDriver.eBrowserType.FireFox); bool v = File.Exists(DriverPath); Assert.AreEqual(true, v); } [TestMethod] - public void GetEdgexDriverPath() + public async Task GetEdgexDriverPath() { - string DriverPath = driver.GetDriverPath(SeleniumDriver.eBrowserType.Edge); + string DriverPath = await driver.GetDriverPath(SeleniumDriver.eBrowserType.Edge); bool v = File.Exists(DriverPath); Assert.AreEqual(true, v); }