0

I am new to Selendroid Testing and I went through the tutorial in the link below:

http://selendroid.io/setup.html

I run the command "java -jar selendroid.jar -app test-app.apk" like it is mentioned in the part called "Launching Selendroid" with the same resources used in tutorial but when I run it, I get this error output:

D:\test_workspace>java -jar selendroid.jar -app test-app.apk
Dec 25, 2016 8:11:53 PM io.selendroid.standalone.SelendroidLauncher main
INFO: ################# Selendroid #################
Dec 25, 2016 8:11:53 PM io.selendroid.standalone.SelendroidLauncher main
INFO: ################# Configuration in use #################
Dec 25, 2016 8:11:53 PM io.selendroid.standalone.SelendroidLauncher main
INFO: io.selendroid.standalone.SelendroidConfiguration@87aac27[
  port=4444
  timeoutEmulatorStart=300000
  supportedApps=[test-app.apk]
  verbose=false
  emulatorPort=5560
  deviceScreenshot=false
  selendroidServerPort=8080
  keystore=<null>
  keystorePassword=<null>
  keystoreAlias=<null>
  emulatorOptions=<null>
  keepEmulator=false
  registrationUrl=<null>
  proxy=<null>
  serverHost=<null>
  keepAdbAlive=false
  maxSession=5
  maxInstances=5
  registerCycle=0
  noWebViewApp=false
  noClearData=false
  sessionTimeoutSeconds=1800
  forceReinstall=false
  logLevel=ERROR
  deviceLog=true
  serverStartTimeout=20000
  printHelp=false
  serverStartRetries=5
  folder=<null>
  deleteTmpFiles=true
]
Dec 25, 2016 8:11:53 PM io.selendroid.standalone.SelendroidLauncher launchServer

INFO: Starting Selendroid standalone on port 4444
Dec 25, 2016 8:11:53 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: D:\android_sdk\build-tools\25.0.2\aapt.exe remove
 D:\test_workspace\test-app.apk META-INF/MANIFEST.MF
Dec 25, 2016 8:11:53 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Shell command output
-->

<--
Dec 25, 2016 8:11:53 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: D:\android_sdk\build-tools\25.0.2\aapt.exe remove
 D:\test_workspace\test-app.apk META-INF/CERT.RSA
Dec 25, 2016 8:11:53 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Shell command output
-->

<--
Dec 25, 2016 8:11:53 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: D:\android_sdk\build-tools\25.0.2\aapt.exe remove
 D:\test_workspace\test-app.apk META-INF/CERT.SF
Dec 25, 2016 8:11:53 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Shell command output
-->

<--
Dec 25, 2016 8:11:53 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: D:\android_sdk\build-tools\25.0.2\aapt.exe remove
 D:\test_workspace\test-app.apk META-INF/ANDROIDD.SF
Dec 25, 2016 8:11:53 PM io.selendroid.standalone.io.ShellCommand exec
SEVERE: Error executing command: D:\android_sdk\build-tools\25.0.2\aapt.exe remo
ve D:\test_workspace\test-app.apk META-INF/ANDROIDD.SF
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit
value: 1)
        at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecut
or.java:377)
        at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:
160)
        at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:
147)
        at io.selendroid.standalone.io.ShellCommand.exec(ShellCommand.java:49)
        at io.selendroid.standalone.android.impl.DefaultAndroidApp.deleteFileFro
mWithinApk(DefaultAndroidApp.java:112)
        at io.selendroid.standalone.builder.SelendroidServerBuilder.deleteFileFr
omAppSilently(SelendroidServerBuilder.java:133)
        at io.selendroid.standalone.builder.SelendroidServerBuilder.resignApp(Se
lendroidServerBuilder.java:145)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.addT
oAppsStore(SelendroidStandaloneDriver.java:121)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.init
ApplicationsUnderTest(SelendroidStandaloneDriver.java:155)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.<ini
t>(SelendroidStandaloneDriver.java:94)
        at io.selendroid.standalone.server.SelendroidStandaloneServer.initialize
SelendroidServer(SelendroidStandaloneServer.java:63)
        at io.selendroid.standalone.server.SelendroidStandaloneServer.<init>(Sel
endroidStandaloneServer.java:52)
        at io.selendroid.standalone.SelendroidLauncher.launchServer(SelendroidLa
uncher.java:65)
        at io.selendroid.standalone.SelendroidLauncher.main(SelendroidLauncher.j
ava:117)

Dec 25, 2016 8:11:53 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: D:\android_sdk\build-tools\25.0.2\aapt.exe remove
 D:\test_workspace\test-app.apk META-INF/ANDROIDD.RSA
Dec 25, 2016 8:11:53 PM io.selendroid.standalone.io.ShellCommand exec
SEVERE: Error executing command: D:\android_sdk\build-tools\25.0.2\aapt.exe remo
ve D:\test_workspace\test-app.apk META-INF/ANDROIDD.RSA
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit
value: 1)
        at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecut
or.java:377)
        at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:
160)
        at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:
147)
        at io.selendroid.standalone.io.ShellCommand.exec(ShellCommand.java:49)
        at io.selendroid.standalone.android.impl.DefaultAndroidApp.deleteFileFro
mWithinApk(DefaultAndroidApp.java:112)
        at io.selendroid.standalone.builder.SelendroidServerBuilder.deleteFileFr
omAppSilently(SelendroidServerBuilder.java:133)
        at io.selendroid.standalone.builder.SelendroidServerBuilder.resignApp(Se
lendroidServerBuilder.java:146)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.addT
oAppsStore(SelendroidStandaloneDriver.java:121)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.init
ApplicationsUnderTest(SelendroidStandaloneDriver.java:155)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.<ini
t>(SelendroidStandaloneDriver.java:94)
        at io.selendroid.standalone.server.SelendroidStandaloneServer.initialize
SelendroidServer(SelendroidStandaloneServer.java:63)
        at io.selendroid.standalone.server.SelendroidStandaloneServer.<init>(Sel
endroidStandaloneServer.java:52)
        at io.selendroid.standalone.SelendroidLauncher.launchServer(SelendroidLa
uncher.java:65)
        at io.selendroid.standalone.SelendroidLauncher.main(SelendroidLauncher.j
ava:117)

Dec 25, 2016 8:11:53 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: D:\android_sdk\build-tools\25.0.2\aapt.exe remove
 D:\test_workspace\test-app.apk META-INF/NDKEYSTO.SF
Dec 25, 2016 8:11:53 PM io.selendroid.standalone.io.ShellCommand exec
SEVERE: Error executing command: D:\android_sdk\build-tools\25.0.2\aapt.exe remo
ve D:\test_workspace\test-app.apk META-INF/NDKEYSTO.SF
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit
value: 1)
        at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecut
or.java:377)
        at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:
160)
        at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:
147)
        at io.selendroid.standalone.io.ShellCommand.exec(ShellCommand.java:49)
        at io.selendroid.standalone.android.impl.DefaultAndroidApp.deleteFileFro
mWithinApk(DefaultAndroidApp.java:112)
        at io.selendroid.standalone.builder.SelendroidServerBuilder.deleteFileFr
omAppSilently(SelendroidServerBuilder.java:133)
        at io.selendroid.standalone.builder.SelendroidServerBuilder.resignApp(Se
lendroidServerBuilder.java:147)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.addT
oAppsStore(SelendroidStandaloneDriver.java:121)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.init
ApplicationsUnderTest(SelendroidStandaloneDriver.java:155)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.<ini
t>(SelendroidStandaloneDriver.java:94)
        at io.selendroid.standalone.server.SelendroidStandaloneServer.initialize
SelendroidServer(SelendroidStandaloneServer.java:63)
        at io.selendroid.standalone.server.SelendroidStandaloneServer.<init>(Sel
endroidStandaloneServer.java:52)
        at io.selendroid.standalone.SelendroidLauncher.launchServer(SelendroidLa
uncher.java:65)
        at io.selendroid.standalone.SelendroidLauncher.main(SelendroidLauncher.j
ava:117)

Dec 25, 2016 8:11:53 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: D:\android_sdk\build-tools\25.0.2\aapt.exe remove
 D:\test_workspace\test-app.apk META-INF/NDKEYSTO.RSA
Dec 25, 2016 8:11:53 PM io.selendroid.standalone.io.ShellCommand exec
SEVERE: Error executing command: D:\android_sdk\build-tools\25.0.2\aapt.exe remo
ve D:\test_workspace\test-app.apk META-INF/NDKEYSTO.RSA
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit
value: 1)
        at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecut
or.java:377)
        at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:
160)
        at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:
147)
        at io.selendroid.standalone.io.ShellCommand.exec(ShellCommand.java:49)
        at io.selendroid.standalone.android.impl.DefaultAndroidApp.deleteFileFro
mWithinApk(DefaultAndroidApp.java:112)
        at io.selendroid.standalone.builder.SelendroidServerBuilder.deleteFileFr
omAppSilently(SelendroidServerBuilder.java:133)
        at io.selendroid.standalone.builder.SelendroidServerBuilder.resignApp(Se
lendroidServerBuilder.java:148)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.addT
oAppsStore(SelendroidStandaloneDriver.java:121)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.init
ApplicationsUnderTest(SelendroidStandaloneDriver.java:155)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.<ini
t>(SelendroidStandaloneDriver.java:94)
        at io.selendroid.standalone.server.SelendroidStandaloneServer.initialize
SelendroidServer(SelendroidStandaloneServer.java:63)
        at io.selendroid.standalone.server.SelendroidStandaloneServer.<init>(Sel
endroidStandaloneServer.java:52)
        at io.selendroid.standalone.SelendroidLauncher.launchServer(SelendroidLa
uncher.java:65)
        at io.selendroid.standalone.SelendroidLauncher.main(SelendroidLauncher.j
ava:117)

Dec 25, 2016 8:11:53 PM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: C:\Program Files\Java\jre1.8.0_111\bin\jarsigner.
exe -sigalg MD5withRSA -digestalg SHA1 -signedjar D:\test_workspace\resigned-tes
t-app.apk -storepass android -keystore C:\Users\heba.ahmad\.android\debug.keysto
re D:\test_workspace\test-app.apk androiddebugkey
Dec 25, 2016 8:11:53 PM io.selendroid.standalone.io.ShellCommand exec
SEVERE: Error executing command: C:\Program Files\Java\jre1.8.0_111\bin\jarsigne
r.exe -sigalg MD5withRSA -digestalg SHA1 -signedjar D:\test_workspace\resigned-t
est-app.apk -storepass android -keystore C:\Users\heba.ahmad\.android\debug.keys
tore D:\test_workspace\test-app.apk androiddebugkey
java.io.IOException: Cannot run program "C:\Program Files\Java\jre1.8.0_111\bin\
jarsigner.exe" (in directory "."): CreateProcess error=2, The system cannot find
 the file specified
        at java.lang.ProcessBuilder.start(Unknown Source)
        at java.lang.Runtime.exec(Unknown Source)
        at org.apache.commons.exec.launcher.Java13CommandLauncher.exec(Java13Com
mandLauncher.java:58)
        at org.apache.commons.exec.DefaultExecutor.launch(DefaultExecutor.java:2
54)
        at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecut
or.java:319)
        at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:
160)
        at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:
147)
        at io.selendroid.standalone.io.ShellCommand.exec(ShellCommand.java:49)
        at io.selendroid.standalone.builder.SelendroidServerBuilder.signTestServ
er(SelendroidServerBuilder.java:296)
        at io.selendroid.standalone.builder.SelendroidServerBuilder.resignApp(Se
lendroidServerBuilder.java:154)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.addT
oAppsStore(SelendroidStandaloneDriver.java:121)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.init
ApplicationsUnderTest(SelendroidStandaloneDriver.java:155)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.<ini
t>(SelendroidStandaloneDriver.java:94)
        at io.selendroid.standalone.server.SelendroidStandaloneServer.initialize
SelendroidServer(SelendroidStandaloneServer.java:63)
        at io.selendroid.standalone.server.SelendroidStandaloneServer.<init>(Sel
endroidStandaloneServer.java:52)
        at io.selendroid.standalone.SelendroidLauncher.launchServer(SelendroidLa
uncher.java:65)
        at io.selendroid.standalone.SelendroidLauncher.main(SelendroidLauncher.j
ava:117)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find th
e file specified
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(Unknown Source)
        at java.lang.ProcessImpl.start(Unknown Source)
        ... 17 more

Dec 25, 2016 8:11:53 PM io.selendroid.standalone.SelendroidLauncher launchServer

SEVERE: Error building server: An error occurred while resigning the app 'test-a
pp.apk'.
Exception in thread "main" io.selendroid.server.common.exceptions.SessionNotCrea
tedException: An error occurred while resigning the app 'test-app.apk'.
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.addT
oAppsStore(SelendroidStandaloneDriver.java:124)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.init
ApplicationsUnderTest(SelendroidStandaloneDriver.java:155)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.<ini
t>(SelendroidStandaloneDriver.java:94)
        at io.selendroid.standalone.server.SelendroidStandaloneServer.initialize
SelendroidServer(SelendroidStandaloneServer.java:63)
        at io.selendroid.standalone.server.SelendroidStandaloneServer.<init>(Sel
endroidStandaloneServer.java:52)
        at io.selendroid.standalone.SelendroidLauncher.launchServer(SelendroidLa
uncher.java:65)
        at io.selendroid.standalone.SelendroidLauncher.main(SelendroidLauncher.j
ava:117)
Caused by: io.selendroid.standalone.exceptions.ShellCommandException: Error exec
uting shell command: C:\Program Files\Java\jre1.8.0_111\bin\jarsigner.exe -sigal
g MD5withRSA -digestalg SHA1 -signedjar D:\test_workspace\resigned-test-app.apk
-storepass android -keystore C:\Users\heba.ahmad\.android\debug.keystore D:\test
_workspace\test-app.apk androiddebugkey
        at io.selendroid.standalone.io.ShellCommand.exec(ShellCommand.java:56)
        at io.selendroid.standalone.builder.SelendroidServerBuilder.signTestServ
er(SelendroidServerBuilder.java:296)
        at io.selendroid.standalone.builder.SelendroidServerBuilder.resignApp(Se
lendroidServerBuilder.java:154)
        at io.selendroid.standalone.server.model.SelendroidStandaloneDriver.addT
oAppsStore(SelendroidStandaloneDriver.java:121)
        ... 6 more
Caused by: io.selendroid.standalone.exceptions.ShellCommandException:
        ... 10 more

D:\test_workspace>


**Note that I searched a lot about it with no luck
so how can I fix this error?**
  • try re-starting your PC – ChathuD Dec 26 '16 at 4:10
0

I found the solution that I added Java JDK as environment variable like the answer below: https://stackoverflow.com/a/26640589/3684096

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.