What is the best practice for using the Appium Server Start and Stop on every test class start and Stop or anything else??
I am adding AppiumServer.start(); and AppiumServer.stop(); on every test class @Before and @After Test. When I run all the test class through the testng.xml after running 2/3 classes I get the socket hang up error.
It is best to start appium server for a session , you run all your tests and then close appium session. If you are using pytest then use session scope pytest fixture. Use yield
after starting server and once tests are finished running, then stops server.