Appium restarts the application before running the test

Hi,

I was wondering if there is a way to stop appium from starting the application twice. Every test it starts a test, it starts the app and then stop it after 5 seconds into the test (in case of the iOS Simulator it shuts down the simulator) and then it resumes the test normally. I have the capabilities set to
caps.setCapability(“fullReset”, “false”);
caps.setCapability(“noReset”, “true”);

I believe the capability you are looking for is autoLaunch. It’s true by default.

We got around this problem by starting the server outside of the test flow. For example

  StartServer
  test_list.each
    test setup
    run test
    test cleanup
  end
  KillServer
1 Like

That’s very good @willosser but could you elaborate a little more on how did you actually start the server outside of the test flow?

With autoLaunch set to false, would you have to open up the app yourself for every test? Or just once per a test suite run?

If your tests close down your app, then you’d be responsible for restarting it. Our tests require us to interact with other apps on the device, so we already have to do this. If you don’t have that requirement, Appium will start up your application and you won’t need to do that yourself. You many need to provide routines which take you back to a specific known state. We have a method, navigate_to_dashboard, which we can invoke from any screen.

As for how we start the server outside of test flow, we have a method which starts the server, another one which starts the driver which connects to the server, and another which calls these two in consecutive order. Once that’s done, we cycle through our test cases. I suspect that’s not what you are asking, though. Could you elaborate on what you are asking?