I am running UITest from my local Visual Studio 2022 against a remote server that have MyApp and WinAppDriver.exe installed.
By running these lines on the UITest MyApp starts up and the closes :
DesiredCapabilities appCapabilities = new DesiredCapabilities();
appCapabilities.SetCapability("app", OrbitAppPath);
appCapabilities.SetCapability("deviceName", "WindowsPC");
session = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), appCapabilities);
session.CloseApp();
session.Close();
session.Quit();
The problem is that after test MyApp will end up in the background process list, in this case it means that I can’t start MyApp again until I manually killed the process.
I have tried to add actions to trigger a normal MyApp close and this works, but the process is still hanging around.
If I manually start MyApp and then close it the process will also end up in the background process list but just a couple of seconds, then its gone.
Why do MyApp stay in the background process list while running UITest against WinAppDriver remote?
If the test is executed locally there is code that kills the process if it remains, it looks like this is not really possible on a remote server?
Regards
EDIT : MyApp will start up with a main form that is not shown on startup, instead a login form will be shown. I suspect that WinAppDriver close the login form and then the hidden main form keeps the process running. I have tried to find the hidden main form with session.WindowHandles but it does only hold the login form.