-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to Close Application after test. #159
Comments
I think WinAppDriver should implement the driver.quit() protocol as clean the related process complete, you can not repeat plant of test if the clean process is not reliable. may be start the new process in a job and clean it complete when needed. something like https://github.com/mback2k/group-job/blob/master/group-job/group-job.cpp or https://github.com/gnomeonwin/superpythonprocess At user side, you may try to clean the application by handle by yourself, as you known the window hwnd, you can get related process and kill it, really bad, but a temp work around! like: |
If you do a Session.dispose() using the Appium .Net driver it will close the app. You can also look for you close button and send it a click, but the dispose should work. |
Hi @sproatba, Each Windows Application Driver session is associated with one application window that could be your main window, settings dialog, or even splash screen as long as they share the same process id. Once the session is established, you can switch between these windows as follows. // Return all window handles associated with this process/application.
var allWindowHandles = session.WindowHandles;
// Switch to any window handle returned in the list
session.SwitchTo().Window(allWindowHandles[0]); In the scenario you described above, you click the ok button that dismisses your settings dialog and the application session is still pointing to the dialog you just closed. Issuing One way to verify that you have your session pointing at the right window is to perform window operations such as In conclusion,
|
I'm trying to test an application which has a splash screen, followed by a settings dialog, followed by the main application window. After creating the WindowsDriver, the splash screen appears then shortly after the settings dialog. If i call windowsDriver.Quit() at this point, the application exits. However, if I click the ok button on the settings dialog then call quit, the main window of the application appears then stays open. I've tried using a PopUpWindowFinder and switching to the new window (which makes finding elements easier), but the application still stays open. I've also tried finding it with a desktop session, but it doesn't close then either. How do I get my application to close properly when the test is done?
The text was updated successfully, but these errors were encountered: