From 314c9fa0ad067f5dbb3aefb3362686bf77238fea Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 8 Mar 2026 00:09:43 +0000 Subject: [PATCH 1/2] Fix compiler warnings CS0108 and CS0168 - `WindowsDriver.cs`: Added `new` to `HideKeyboard(string)` to resolve CS0108 warning about hiding inherited member. - `AppiumCommandExecutor.cs`: Removed unused exception variable `e` to resolve CS0168 warning. Co-authored-by: Dor-bl <59066376+Dor-bl@users.noreply.github.com> --- src/Appium.Net/Appium/Service/AppiumCommandExecutor.cs | 2 +- src/Appium.Net/Appium/Windows/WindowsDriver.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Appium.Net/Appium/Service/AppiumCommandExecutor.cs b/src/Appium.Net/Appium/Service/AppiumCommandExecutor.cs index 319b961d8..8c6ec78a7 100644 --- a/src/Appium.Net/Appium/Service/AppiumCommandExecutor.cs +++ b/src/Appium.Net/Appium/Service/AppiumCommandExecutor.cs @@ -72,7 +72,7 @@ public async Task ExecuteAsync(Command commandToExecute) } return result; } - catch (Exception e) + catch (Exception) { HandleCommandException(commandToExecute); diff --git a/src/Appium.Net/Appium/Windows/WindowsDriver.cs b/src/Appium.Net/Appium/Windows/WindowsDriver.cs index 49347f8b8..5b402d326 100644 --- a/src/Appium.Net/Appium/Windows/WindowsDriver.cs +++ b/src/Appium.Net/Appium/Windows/WindowsDriver.cs @@ -175,7 +175,7 @@ public override ReadOnlyCollection Contexts #endregion Context - public void HideKeyboard(string key) => + public new void HideKeyboard(string key) => AppiumCommandExecutionHelper.HideKeyboard(this, key); public void PressKeyCode(KeyEvent keyEvent) => throw new NotImplementedException(); From 8dec8cefb4d9bd46b124c7e8698e6632afbb6c25 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sun, 8 Mar 2026 01:00:10 +0000 Subject: [PATCH 2/2] Fix compiler warnings across the project - Added `new` to `HideKeyboard(string)` in `WindowsDriver.cs` (CS0108). - Removed unused exception variable `e` in `AppiumCommandExecutor.cs` and `StartingAppLocallyTest.cs` (CS0168). - Changed `StickyNotesTest` to be `abstract` (NUnit1034). - Swapped actual and expected values in `WaitTests.cs` (NUnit2007). - Suppressed `CA1416` in `ClipboardTest.cs` for image processing APIs. Co-authored-by: Dor-bl <59066376+Dor-bl@users.noreply.github.com> --- test/integration/Android/WaitTests.cs | 4 ++-- test/integration/IOS/ClipboardTest.cs | 4 ++++ test/integration/ServerTests/StartingAppLocallyTest.cs | 2 +- test/integration/Windows/StickyNotesTest.cs | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/integration/Android/WaitTests.cs b/test/integration/Android/WaitTests.cs index a00fabe11..e6ee72cd7 100644 --- a/test/integration/Android/WaitTests.cs +++ b/test/integration/Android/WaitTests.cs @@ -55,7 +55,7 @@ public void WebDriverWaitElementNotFoundTestCase() catch (Exception wx) { var excpetionType = wx.GetType(); - Assert.That(typeof(WebDriverTimeoutException), Is.EqualTo(excpetionType)); + Assert.That(excpetionType, Is.EqualTo(typeof(WebDriverTimeoutException))); } } @@ -76,7 +76,7 @@ public void WebDriverWaitIsWaitingTestCase() { stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Assert.That(_driverTimeOut.Seconds, Is.EqualTo(ts.Seconds)); + Assert.That(ts.Seconds, Is.EqualTo(_driverTimeOut.Seconds)); } } diff --git a/test/integration/IOS/ClipboardTest.cs b/test/integration/IOS/ClipboardTest.cs index bafaf703f..5a9d12696 100644 --- a/test/integration/IOS/ClipboardTest.cs +++ b/test/integration/IOS/ClipboardTest.cs @@ -63,6 +63,7 @@ public void WhenSetClipboardUrl_GetClipboardUrlShouldReturnUrl() } [Test] +#pragma warning disable CA1416 public void WhenSetClipboardContentTypeIsImage_GetClipboardShouldReturnEncodedBase64String() { var testImageBytes = _driver.GetScreenshot().AsByteArray; @@ -72,13 +73,16 @@ public void WhenSetClipboardContentTypeIsImage_GetClipboardShouldReturnEncodedBa Assert.That(() => Regex.IsMatch(_driver.GetClipboard(ClipboardContentType.Image), Base64RegexPattern, RegexOptions.Multiline), Is.True); } +#pragma warning restore CA1416 [Test] +#pragma warning disable CA1416 public void WhenClipboardHasNoImage_GetClipboardImageShouldReturnNull() { _driver.SetClipboardText(ClipboardTestString); Assert.That(() => _driver.GetClipboardImage(), Is.Null); } +#pragma warning restore CA1416 [Test] public void WhenClipboardIsEmpty_GetClipboardShouldReturnEmptyString() diff --git a/test/integration/ServerTests/StartingAppLocallyTest.cs b/test/integration/ServerTests/StartingAppLocallyTest.cs index 762d46b4a..432b2ef9b 100644 --- a/test/integration/ServerTests/StartingAppLocallyTest.cs +++ b/test/integration/ServerTests/StartingAppLocallyTest.cs @@ -148,7 +148,7 @@ public void CheckThatServiceIsNotRunWhenTheCreatingOfANewSessionIsFailed() { driver = new IOSDriver(service, capabilities); } - catch (Exception e) + catch (Exception) { Assert.That(!service.IsRunning); return; diff --git a/test/integration/Windows/StickyNotesTest.cs b/test/integration/Windows/StickyNotesTest.cs index d6b1c634c..b5760fc89 100644 --- a/test/integration/Windows/StickyNotesTest.cs +++ b/test/integration/Windows/StickyNotesTest.cs @@ -22,7 +22,7 @@ namespace Appium.Net.Integration.Tests.Windows { - public class StickyNotesTest + public abstract class StickyNotesTest { private const string StickyNotesAppId = @"Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe!App";