Some tests often terminate the session or fail with an uninitialized problem

If you run a test method after writing a script, the session works well.
However, when you run a full test of TestSuite, some tests often terminate the session or fail with an uninitialized problem. I want to know the cause and solution of this problem.

can you share complete appium server log related to this test run, without that it will be difficult to debug.

When executing the first test, UIAutomator is terminated after finding no specific element. If the test is executed after that, the test does not proceed because the driver session is terminated and an error occurs. Then, when another suite is executed, a driver session starts and operates normally.

log (1).txt (29.8 KB)

If you do not terminate the session properly, then on the next execution server refuses your connection because it doesn’t match the active session.

You should terminate your session with driver.quit()

What I also do is launching the appium server with the override session capability, so that even if one session does not terminate properly, appium will still accept new session requests (killing the existing one):

appium -p 4730 --session-override

This doesn’t fix my problem. I am having the same problem