dotnet-client icon indicating copy to clipboard operation
dotnet-client copied to clipboard

[Bug]: The `WindowsDriver` lacks support for `ActivateApp`/`TerminateApp` since `LaunchApp` was removed and `CloseApp` moved

Open Redth opened this issue 1 year ago • 0 comments

Description

In the 5.0.0 release there were changes to both LaunchApp and CloseApp which both have been deprecated for some time. The alternatives suggest using ActivateApp and TerminateApp I believe. On windows however, neither of these are implemented in the driver and throw exceptions when you try to call them.

  • LaunchApp was removed completely
  • CloseApp was moved from the appium driver to the windows specific driver

So, CloseApp still 'works' by casting to WindowsDriver first, however the only way I've found to work around the removal of LaunchApp is to call driver.ExecuteScript("windows: launchApp", ["my-app-id"]); (though I think app id is unnecessary here).

I'm not sure if it's considered incorrect to make ActivateApp and TerminateApp implement the working calls so that the same method does work xplat, or if the fix considered most correct is to do the same thing for LaunchApp that was done to CloseApp and bring back an implementation for it just on WindowsDriver.

Environment

  • .NET client build version or git revision if you use some snapshot: 5.0.0
  • Appium server version or git revision if you use some snapshot: 2.10.3
  • Desktop OS/version used to run Appium if necessary: Windows
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: 20.4.0
  • Mobile platform/version under test: Windows
  • Real device or emulator/simulator: Device

Redth avatar Jun 18 '24 18:06 Redth