Error during running test parallel with selenium grid (some activity never started)

Sometimes I get error when running test in several devices parallel: “Failed to start an Appium session err was: Error: someActivity never started. Current: anotherActivity”

In my case:
Failed to start an Appium session, err was: Error: com.olx.olx/ui.activities.SplashActivity never started. Current: com.olx.olx/ui.activities.TutorialActivity

This error occurs occasionally. More often, when I run test on 4 or more devices.

What it can be?

It looks like your application has a “starter” activity that simply launches the “real” activity. I’m not particularly fond of this sort of design in Android application development, but many apps follow this pattern.

Appium only knows when to return control back to your test code when the activity Appium is waiting on is launched. However, Appium can not know how your particular application is designed, so it doesn’t know if the app follows this “starter->real” activity design. Appium provides a solution for this particular design:

  1. Add in an “appWaitPackage” capability to your desired capabilities. Set it to the application ID of the “real” activity that should be launched (e.g. com.example.myapp)
  2. Add in an “appWaitActivity” capability to your desired capabilites. Set it to the full name of the “real” activity’s class (e.g. com.example.myapp.MainActivity).

I added the appWaitAcitivty and appWaitPackade. But I still get this error. Not often. This error often occurs when I run test on several devices (parallel)

Are you waiting on the correct package and activities? Can you post a Gist of your logs?