Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37363

Android app automated job fails due to No device found

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Actually I scheduled my appium-android automation script to run in jenkins using AWS device Farm.All setup is good and the job is running in AWS devices properly ,,However the build becomes unstable due to setup error with appium server and ADB

      As I am running in remote machine and the scripts is to run in AWS device farm, there is no physical device attached in cloud machine and appium server is not running locally.

      So now, how do i make my build success?

      Am pasting my logs here

      Started by timer
      Building in workspace C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest
      Parsing POMs
      [Android-SanityTest] $ "C:\Program Files\Java\jdk1.8.0_77/bin/java" -cp "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven31-agent-1.5.jar;C:\Program Files\apache-maven-3.3.9\boot\plexus-classworlds-2.5.2.jar;C:\Program Files\apache-maven-3.3.9/conf/logging" jenkins.maven3.agent.Maven31Main "C:\Program Files\apache-maven-3.3.9" "C:\Program Files (x86)\Jenkins\war\WEB-INF\lib\remoting-2.59.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven31-interceptor-1.5.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.5.jar" 56446
      <===[JENKINS REMOTING CAPACITY]===>channel started
      Executing Maven: -B -f C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest\pom.xml install
      [INFO] Scanning for projects...
      [INFO]

      [INFO] ------------------------------------------------------------------------
      [INFO] Building android 1.0-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [INFO]
      [INFO] — maven-resources-plugin:2.6:resources (default-resources) @ android —
      [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
      [INFO] skip non existing resourceDirectory C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest\src\main\resources
      [INFO]
      [INFO] — maven-compiler-plugin:3.1:compile (default-compile) @ android —
      [INFO] Changes detected - recompiling the module!
      [WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
      [INFO] Compiling 1 source file to C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest\target\classes
      [INFO]
      [INFO] — maven-resources-plugin:2.6:testResources (default-testResources) @ android —
      [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
      [INFO] skip non existing resourceDirectory C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest\src\test\resources
      [INFO]
      [INFO] — maven-compiler-plugin:3.1:testCompile (default-testCompile) @ android —
      [INFO] Nothing to compile - all classes are up to date
      [INFO]
      [INFO] — maven-surefire-plugin:2.12.4:test (default-test) @ android —
      [INFO] Surefire report directory: C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest\target\surefire-reports

      T E S T S

      Running Tests.AppTest
      Configuring TestNG with: org.apache.maven.surefire.testng.conf.TestNG652Configurator@e2d56bf
      Tests run: 3, Failures: 1, Errors: 0, Skipped: 2, Time elapsed: 29.108 sec <<< FAILURE!
      setUp(Tests.AppTest) Time elapsed: 28.929 sec <<< FAILURE!
      org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Could not find a connected Android device.) (WARNING: The server did not provide any stacktrace information)
      Command duration or timeout: 27.84 seconds
      Build info: version: '2.46.0', revision: '61506a4624b13675f24581e453592342b7485d71', time: '2015-06-04 10:22:50'
      System info: host: 'WIN-LGTFBEGGTAM', ip: '172.22.5.89', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_77'
      Driver info: io.appium.java_client.android.AndroidDriver
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
      at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
      at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:605)
      at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:27)
      at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
      at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
      at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)
      at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:128)
      at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:155)
      at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:22)
      at io.appium.java_client.AppiumDriver.(AppiumDriver.java:202)
      at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:50)
      at Tests.AppTest.setUp(AppTest.java:49)

      Results :

      Failed tests: setUp(Tests.AppTest): A new session could not be created. (Original error: Could not find a connected Android device.) (WARNING: The server did not provide any stacktrace information)(..)

      Tests run: 3, Failures: 1, Errors: 0, Skipped: 2

      [ERROR] There are test failures.

      Please refer to C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest\target\surefire-reports for the individual test results.
      [JENKINS] Recording test results
      [INFO]
      [INFO] — maven-jar-plugin:2.6:jar (default-jar) @ android —
      [INFO] Building jar: C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest\target\android-1.0-SNAPSHOT.jar
      [INFO]
      [INFO] — maven-jar-plugin:2.6:test-jar (default) @ android —
      [INFO]
      [INFO] — maven-dependency-plugin:2.10:copy-dependencies (copy-dependencies) @ android —
      [INFO] org.apache.commons:commons-lang3:jar:3.4 already exists in destination.
      [INFO] org.seleniumhq.selenium:selenium-leg-rc:jar:2.46.0 already exists in destination.
      [INFO] net.java.dev.jna:jna-platform:jar:4.1.0 already exists in destination.
      [INFO] io.netty:netty:jar:3.5.2.Final already exists in destination.
      [INFO] org.w3c.css:sac:jar:1.3 already exists in destination.
      [INFO] org.apache.httpcomponents:httpclient:jar:4.3.3 already exists in destination.
      [INFO] io.appium:java-client:jar:3.1.0 already exists in destination.
      [INFO] org.beanshell:bsh:jar:2.0b4 already exists in destination.
      [INFO] org.seleniumhq.selenium:selenium-htmlunit-driver:jar:2.46.0 already exists in destination.
      [INFO] commons-collections:commons-collections:jar:3.2.1 already exists in destination.
      [INFO] org.seleniumhq.selenium:selenium-safari-driver:jar:2.46.0 already exists in destination.
      [INFO] com.google.guava:guava:jar:17.0 already exists in destination.
      [INFO] org.seleniumhq.selenium:selenium-firefox-driver:jar:2.46.0 already exists in destination.
      [INFO] net.sourceforge.htmlunit:htmlunit:jar:2.17 already exists in destination.
      [INFO] org.apache.commons:commons-exec:jar:1.3 already exists in destination.
      [INFO] xerces:xercesImpl:jar:2.11.0 already exists in destination.
      [INFO] xml-apis:xml-apis:jar:1.4.01 already exists in destination.
      [INFO] org.eclipse.jetty.websocket:websocket-client:jar:9.2.11.v20150529 already exists in destination.
      [INFO] cglib:cglib-nodep:jar:2.1_3 already exists in destination.
      [INFO] org.apache.httpcomponents:httpcore:jar:4.3.2 already exists in destination.
      [INFO] net.sourceforge.cssparser:cssparser:jar:0.9.16 already exists in destination.
      [INFO] commons-io:commons-io:jar:2.4 already exists in destination.
      [INFO] net.sourceforge.htmlunit:htmlunit-core-js:jar:2.17 already exists in destination.
      [INFO] com.beust:jcommander:jar:1.27 already exists in destination.
      [INFO] org.seleniumhq.selenium:selenium-chrome-driver:jar:2.46.0 already exists in destination.
      [INFO] org.seleniumhq.selenium:selenium-remote-driver:jar:2.46.0 already exists in destination.
      [INFO] cglib:cglib:jar:3.1 already exists in destination.
      [INFO] org.eclipse.jetty.websocket:websocket-common:jar:9.2.11.v20150529 already exists in destination.
      [INFO] xalan:serializer:jar:2.7.2 already exists in destination.
      [INFO] org.testng:testng:jar:6.8.8 already exists in destination.
      [INFO] org.seleniumhq.selenium:selenium-api:jar:2.46.0 already exists in destination.
      [INFO] org.apache.httpcomponents:httpmime:jar:4.4.1 already exists in destination.
      [INFO] org.webbitserver:webbit:jar:0.4.14 already exists in destination.
      [INFO] commons-logging:commons-logging:jar:1.1.3 already exists in destination.
      [INFO] xalan:xalan:jar:2.7.2 already exists in destination.
      [INFO] org.eclipse.jetty.websocket:websocket-api:jar:9.2.11.v20150529 already exists in destination.
      [INFO] org.eclipse.jetty:jetty-io:jar:9.2.11.v20150529 already exists in destination.
      [INFO] org.seleniumhq.selenium:selenium-ie-driver:jar:2.46.0 already exists in destination.
      [INFO] org.seleniumhq.selenium:selenium-java:jar:2.46.0 already exists in destination.
      [INFO] net.sourceforge.nekohtml:nekohtml:jar:1.9.22 already exists in destination.
      [INFO] com.google.code.gson:gson:jar:2.2.4 already exists in destination.
      [INFO] net.java.dev.jna:jna:jar:4.1.0 already exists in destination.
      [INFO] commons-codec:commons-codec:jar:1.6 already exists in destination.
      [INFO] org.seleniumhq.selenium:selenium-support:jar:2.46.0 already exists in destination.
      [INFO] org.ow2.asm:asm:jar:4.2 already exists in destination.
      [INFO] org.eclipse.jetty:jetty-util:jar:9.2.11.v20150529 already exists in destination.
      [INFO]
      [INFO] — maven-assembly-plugin:2.5.4:single (default) @ android —
      [INFO] Reading assembly descriptor: src/main/assembly/zip.xml
      [INFO] Building zip: C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest\target\zip-with-dependencies.zip
      [INFO]
      [INFO] — maven-install-plugin:2.4:install (default-install) @ android —
      [INFO] Installing C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest\target\android-1.0-SNAPSHOT.jar to C:\Users\Administrator.m2\repository\android\android\1.0-SNAPSHOT\android-1.0-SNAPSHOT.jar
      [INFO] Installing C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest\pom.xml to C:\Users\Administrator.m2\repository\android\android\1.0-SNAPSHOT\android-1.0-SNAPSHOT.pom
      [INFO] Installing C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest\target\android-1.0-SNAPSHOT-tests.jar to C:\Users\Administrator.m2\repository\android\android\1.0-SNAPSHOT\android-1.0-SNAPSHOT-tests.jar
      [INFO] Installing C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest\target\zip-with-dependencies.zip to C:\Users\Administrator.m2\repository\android\android\1.0-SNAPSHOT\android-1.0-SNAPSHOT.zip
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 41.152 s
      [INFO] Finished at: 2016-08-11T11:46:50-04:00
      [INFO] Final Memory: 35M/499M
      [INFO] ------------------------------------------------------------------------
      [JENKINS] Archiving C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest\pom.xml to android/android/1.0-SNAPSHOT/android-1.0-SNAPSHOT.pom
      [JENKINS] Archiving C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest\target\android-1.0-SNAPSHOT.jar to android/android/1.0-SNAPSHOT/android-1.0-SNAPSHOT.jar
      [JENKINS] Archiving C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest\target\android-1.0-SNAPSHOT-tests.jar to android/android/1.0-SNAPSHOT/android-1.0-SNAPSHOT-tests.jar
      [JENKINS] Archiving C:\Program Files (x86)\Jenkins\workspace\Android-SanityTest\target\zip-with-dependencies.zip to android/android/1.0-SNAPSHOT/android-1.0-SNAPSHOT.zip
      channel stopped
      [AWSDeviceFarm] Using Project 'Android - Sanity Testing'
      [AWSDeviceFarm] Using DevicePool 'Daily Test'
      [AWSDeviceFarm] Using App '**/STOPit-Play-store-8.3-(171).apk'
      [AWSDeviceFarm] Archiving artifact 'STOPit-Play-store-8.3-(171).apk'
      [AWSDeviceFarm] Uploading STOPit-Play-store-8.3-(171).apk to S3
      [AWSDeviceFarm] Waiting for upload STOPit-Play-store-8.3-(171).apk to be ready (current status: INITIALIZED)
      [AWSDeviceFarm] Upload STOPit-Play-store-8.3-(171).apk succeeded
      [AWSDeviceFarm] Getting test to schedule.
      [AWSDeviceFarm] Archiving artifact 'zip-with-dependencies.zip'
      [AWSDeviceFarm] Uploading zip-with-dependencies.zip to S3
      [AWSDeviceFarm] Waiting for upload zip-with-dependencies.zip to be ready (current status: INITIALIZED)
      [AWSDeviceFarm] Upload zip-with-dependencies.zip succeeded
      [AWSDeviceFarm] Scheduling 'APPIUM_JAVA_TESTNG' run 'AndroidApp-Sanity Test jenkins-Android-SanityTest-643'
      [AWSDeviceFarm] View the APPIUM_JAVA_TESTNG run in the AWS Device Farm Console: https://console.aws.amazon.com/devicefarm/home?#/projects/f529b47c-d777-4da1-85d2-a55e26d5e071/runs/5e18676b-9f91-4037-9e46-42993ff26890
      [AWSDeviceFarm] Waiting for test run to complete.
      [AWSDeviceFarm] Run AndroidApp-Sanity Test jenkins-Android-SanityTest-643 status SCHEDULING
      [AWSDeviceFarm] Run AndroidApp-Sanity Test jenkins-Android-SanityTest-643 status RUNNING
      [AWSDeviceFarm] Run AndroidApp-Sanity Test jenkins-Android-SanityTest-643 status RUNNING
      [AWSDeviceFarm] Run AndroidApp-Sanity Test jenkins-Android-SanityTest-643 status RUNNING
      [AWSDeviceFarm] Run AndroidApp-Sanity Test jenkins-Android-SanityTest-643 status RUNNING
      [AWSDeviceFarm] Run AndroidApp-Sanity Test jenkins-Android-SanityTest-643 status RUNNING
      [AWSDeviceFarm] Run AndroidApp-Sanity Test jenkins-Android-SanityTest-643 status RUNNING
      [AWSDeviceFarm] Run AndroidApp-Sanity Test jenkins-Android-SanityTest-643 status RUNNING
      [AWSDeviceFarm] Run AndroidApp-Sanity Test jenkins-Android-SanityTest-643 status RUNNING
      [AWSDeviceFarm] Run AndroidApp-Sanity Test jenkins-Android-SanityTest-643 status RUNNING
      [AWSDeviceFarm] Run AndroidApp-Sanity Test jenkins-Android-SanityTest-643 status RUNNING
      [AWSDeviceFarm] Run AndroidApp-Sanity Test jenkins-Android-SanityTest-643 status RUNNING
      [AWSDeviceFarm] Run AndroidApp-Sanity Test jenkins-Android-SanityTest-643 status RUNNING
      [AWSDeviceFarm] Run AndroidApp-Sanity Test jenkins-Android-SanityTest-643 status RUNNING
      [AWSDeviceFarm] Run AndroidApp-Sanity Test jenkins-Android-SanityTest-643 status RUNNING
      [AWSDeviceFarm] Run AndroidApp-Sanity Test jenkins-Android-SanityTest-643 status COMPLETED
      [AWSDeviceFarm] Test run is complete.
      Finished: UNSTABLE

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            Assignee:
            ahawker Andrew Hawker
            Reporter:
            kannaki kannaki Ramamoorthy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: