{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/WinAppDriver/issues/409","repository_url":"https://api.github.com/repos/Microsoft/WinAppDriver","labels_url":"https://api.github.com/repos/Microsoft/WinAppDriver/issues/409/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/WinAppDriver/issues/409/comments","events_url":"https://api.github.com/repos/Microsoft/WinAppDriver/issues/409/events","html_url":"https://github.com/Microsoft/WinAppDriver/issues/409","id":318985152,"number":409,"title":"Handle relaunch after application crash?","user":{"login":"caulfield2","id":25783833,"avatar_url":"https://avatars2.githubusercontent.com/u/25783833?v=4","gravatar_id":"","url":"https://api.github.com/users/caulfield2","html_url":"https://github.com/caulfield2","followers_url":"https://api.github.com/users/caulfield2/followers","following_url":"https://api.github.com/users/caulfield2/following{/other_user}","gists_url":"https://api.github.com/users/caulfield2/gists{/gist_id}","starred_url":"https://api.github.com/users/caulfield2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caulfield2/subscriptions","organizations_url":"https://api.github.com/users/caulfield2/orgs","repos_url":"https://api.github.com/users/caulfield2/repos","events_url":"https://api.github.com/users/caulfield2/events{/privacy}","received_events_url":"https://api.github.com/users/caulfield2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-30T18:18:01Z","updated_at":"2018-05-01T22:05:41Z","closed_at":null,"author_association":"NONE","body":"I recently ran into a situation where my Windows application crashed during a test, causing all subsequent tests to fail. Has anyone designed some test logic to check if the application is active at the end of each test and relaunch if appropriate before the next test starts? I'm working in C# using the Visual Studio Unit Test project format. "},"comment":{"url":"https://api.github.com/repos/Microsoft/WinAppDriver/issues/comments/385804876","html_url":"https://github.com/Microsoft/WinAppDriver/issues/409#issuecomment-385804876","issue_url":"https://api.github.com/repos/Microsoft/WinAppDriver/issues/409","id":385804876,"user":{"login":"PandaMagnus","id":23488367,"avatar_url":"https://avatars1.githubusercontent.com/u/23488367?v=4","gravatar_id":"","url":"https://api.github.com/users/PandaMagnus","html_url":"https://github.com/PandaMagnus","followers_url":"https://api.github.com/users/PandaMagnus/followers","following_url":"https://api.github.com/users/PandaMagnus/following{/other_user}","gists_url":"https://api.github.com/users/PandaMagnus/gists{/gist_id}","starred_url":"https://api.github.com/users/PandaMagnus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PandaMagnus/subscriptions","organizations_url":"https://api.github.com/users/PandaMagnus/orgs","repos_url":"https://api.github.com/users/PandaMagnus/repos","events_url":"https://api.github.com/users/PandaMagnus/events{/privacy}","received_events_url":"https://api.github.com/users/PandaMagnus/received_events","type":"User","site_admin":false},"created_at":"2018-05-01T22:05:41Z","updated_at":"2018-05-01T22:05:41Z","author_association":"NONE","body":"@caulfield2 aaah, okay understood. Could you invoke a known property on the driver, either in a try/catch or a conditional check? I'm not as familiar with Appium, but in Selenium if I invoke, say, Driver.WindowHandles or Driver.PageSource after I kill a browser, I'll get a return of 0 or NoSuchWindow exception (respective). So, E.G., in test setup:\r\n\r\n```\r\nif(Driver.WindowHandles == 0)\r\n{\r\n// Re-launch the application, maybe re-instantiate a new driver, etc.\r\n}\r\n```\r\n\r\nor...\r\n\r\n```\r\ntry\r\n{\r\nvar _ = Driver.Pagesource;\r\n}\r\ncatch(NoSuchWindowException)\r\n{\r\n// Re-launch the application, maybe re-instantiate a new driver, etc.\r\n}\r\n```\r\n\r\nUnfortunately I don't have WAP at work yet, so I can't check myself. :( If I get to it tonight or tomorrow, I'll check and get back to you."}}
{"actor":{"display_login":"PandaMagnus"}}