Closed DeanPack closed 2 years ago
Appium terminates the app under test via https://developer.apple.com/documentation/xctest/xcuiapplication/1500637-terminate in
[debug] [XCUITestDriver@1df5 (8005f4fd)] Matched '/session/8005f4fd-80a8-4515-b62d-3d6947686576' to command name 'deleteSession'
[debug] [XCUITestDriver@1df5 (8005f4fd)] Proxying [DELETE /session/8005f4fd-80a8-4515-b62d-3d6947686576] to [DELETE http://127.0.0.1:8100/session/8C9842CB-1ADA-44A3-A73A-0811A174B76B] with no body
[debug] [XCUITestDriver@1df5 (8005f4fd)] Got response with status 200: {"value":null,"sessionId":null}
So, perhaps XCTest framework (by Apple) did not terminate your app process properly.
You could try out https://github.com/appium/appium-xcuitest-driver#mobile-killapp to kill the app process outside XCTest
I have a similar error when running on the Android emulator, an example of an error message:
ERROR @wdio/local-runner: Failed launching test session: invalid session id: A session is either terminated or not started
But the session has started and the test runs fine until the await driver.deleteSession();
command is executed.
I'm using WebdriverIO + appium 2.0.0-beta.44 + appium-flutter-driver 1.7.2
It would be helpful to share the full appium server log to find possible issues. It seems like the deleteSession error is another issue. Please create a new issue.
btw, I saw similar reports in the appium repo about Apple's terminate app did not kill their app process occasionally... The original reported issue also potentially the same. Then, my previous comment's one may help
I am using appiums flutter driver to automate my flutter apps testing. When my test conclues, I run driver.deleteSession() as the api says is the same as flutter.close(); Whenever I run my code though, I don't get any errors, but the app doesn't close, I simply get a 200 that says that everything is ok, but the app doesn't actually close. Here is my terminal for driver.deleteSession().
This is especially annoying, because since the session isn't properly deleted whenever I try to run a test again, it fails because the session isn't properly setup and initialization of the new test fails because it can't .match(session) because session is undefined.