Appium opens app but crashes when executing test


Im using the next project to create a demo of appium using Windows Appium GUI and Android Studio:

But when I try to execute the test with appium the app opens in the emulator but it doesn’t continue with the tests and exits with an error but sometimes it works fine when I restart Appium and the emulator

Error log

[INFO] -------------------------------------------------------
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
[INFO ] 2022-10-05 13:18:44.243 ServerManager:46 - starting appium server
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See for further details.
[Appium] Welcome to Appium v1.22.3
[Appium] Non-default server args:
[Appium]   port: 47492
[Appium]   sessionOverride: true
[Appium]   logFile: C:\AppiumPOC\Android_Pixel 4 API 3O\Server.log
[Appium] Appium REST http interface listener started on
[HTTP] --> GET /wd/hub/status
[HTTP] {}
[debug] [GENERIC] Calling AppiumDriver.getStatus() with args: []
[debug] [GENERIC] Responding to client with driver.getStatus() result: {"build":{"version":"1.22.3"}}
[HTTP] <-- GET /wd/hub/status 200 10 ms - 68
[HTTP] --> GET /wd/hub/status
[HTTP] {}
[debug] [GENERIC] Calling AppiumDriver.getStatus() with args: []
[debug] [GENERIC] Responding to client with driver.getStatus() result: {"build":{"version":"1.22.3"}}
[INFO ] 2022-10-05 13:18:51.233 ServerManager:62 - Appium server started
[INFO ] 2022-10-05 13:18:51.290 DriverManager:42 - initializing Appium driver
[INFO ] 2022-10-05 13:18:51.323 PropertyManager:31 - loading config properties
[INFO ] 2022-10-05 13:18:51.325 CapabilitiesManager:33 - getting capabilities
[INFO ] 2022-10-05 13:18:51.330 CapabilitiesManager:58 - appUrl is C:\AppiumPOC\src\test\resources\app\AS.apk
[Utils] [ERROR] [Error] java.lang.NullPointerException
        at com.appium.runners.RunnerBase.scenarios(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.testng.internal.MethodInvocationHelper.invokeMethod(
        at org.testng.internal.MethodInvocationHelper.invokeMethod(
        at org.testng.internal.MethodInvocationHelper.invokeMethodNoCheckedException(
        at org.testng.internal.MethodInvocationHelper.invokeDataProvider(
        at org.testng.internal.Parameters.handleParameters(
        at org.testng.internal.Parameters.handleParameters(
        at org.testng.internal.ParameterHandler.handleParameters(
        at org.testng.internal.ParameterHandler.createParameters(
        at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(
        at org.testng.internal.TestInvoker.invokeTestMethods(
        at org.testng.internal.TestMethodWorker.invokeTestMethods(
        at java.util.ArrayList.forEach(
        at org.testng.TestRunner.privateRun(
        at org.testng.SuiteRunner.runTest(
        at org.testng.SuiteRunner.runSequentially(
        at org.testng.SuiteRunner.privateRun(
        at org.testng.SuiteRunnerWorker.runSuite(
        at org.testng.TestNG.runSuitesSequentially(
        at org.testng.TestNG.runSuitesLocally(
        at org.testng.TestNG.runSuites(
        at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(
        at org.apache.maven.surefire.testng.TestNGProvider.invoke(
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(
        at org.apache.maven.surefire.booter.ForkedBooter.execute(
        at org.apache.maven.surefire.booter.ForkedBooter.main(

[ERROR] Tests run: 3, Failures: 2, Errors: 0, Skipped: 1, Time elapsed: 45.537 s <<< FAILURE! - in TestSuite
[ERROR] com.appium.runners.TestNGRunner_Pixel3.setUpClass[Android, emulator-5554, Pixel 4 API 3O, 10000, 11000, iOS, iOS](0)  Time elapsed: 45.308 s  <<
Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while process
ing the command. Original error: Cannot start the '' application. Visit
running-appium/android/ for troubleshooting. Original error: 'es.sdos.splash.ui.SplashActivity' or '
h.ui.SplashActivity' never started. Visit for tr
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'HL-013080', ip: '', 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_301'
Driver info: driver.version: AndroidDriver
remote stacktrace: UnknownError: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'es.mmip.prisacom.
as' application. Visit for troubleshooting. Orig
inal error: 'es.sdos.splash.ui.SplashActivity' or '' never started. Visit
appium/blob/master/docs/en/writing-running-appium/android/ for troubleshooting
    at getResponseForW3CError (C:\Users\rteresa\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:804:9)
    at asyncHandler (C:\Users\rteresa\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\protocol\protocol.js:380:37)


Problem could be with emulators itself. Try changing OS or Emulator Device Model.

Answered By – Rakesh K

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published