How can close windows app when the session created with "appTopLevelWindow" capability?


My tested app sometimes had started 2 times, when the session/driver is created. I added the “ms:waitForAppLaunch” capability but it did not help.
So, I decreased the “createSessionTimeout” and after the session creation is failed I attached a new session to the previously started app with the “appTopLevelWindow” capability
It is suggested by

It helped to start the app, just once, and attach session to it, but in this case the app is not close when I call the session.quit or session.close.
I see that the WinAppDriver supports a /forcequit command parameter which maybe can help.
How can I pass this parameter by Appium to webappdriver?
(I’m using it from java)

Is there any idea for my problem?


My bad!

With the “closeApp” can close the application