vkshukla
vkshukla

Reputation: 21

Running Appium/TestNG script on AWS device farm

When i deploy the zip containing my appium scripts and test.jar (containing all dependency jars used in script) on aws device from run configuration it shows below error-

"could not found test.jar".

Any suggestion what i am missing.

Upvotes: 2

Views: 819

Answers (2)

ahawker
ahawker

Reputation: 3374

If you take a look at step 6 in the instructions, you'll see an example of the expected package structure.

Build, package, and verify. For example:

$ mvn clean package –-DskipTests=true
$ tree target
.
|— acme-android-appium-1.0-SNAPSHOT.jar (this is the JAR containing everything built from the ./src/main directory)
|— acme-android-appium-1.0-SNAPSHOT-tests.jar (this is the JAR containing everything built from the ./src/test directory)
|— zip-with-dependencies.zip (this .zip file contains all of the items)
`— dependency-jars  (this is the directory that contains all of your dependencies, built as JAR files)
      |— com.some-dependency.bar-4.1.jar
      |— com.another-dependency.thing-1.0.jar
      |— joda-time-2.7.jar
      |— log4j-1.2.14.jar
      |— (and so on...)

The two key areas to look at here are:

  • acme-android-appium-1.0-SNAPSHOT.jar
  • acme-android-appium-1.0-SNAPSHOT-tests.jar

Device Farm expects the uploaded package to contain JAR files built from both your ./src/main and ./src/test directories. Based on the error message, it is unable to find a *-tests.jar file inside of your uploaded package.

My questions for you would be:

  • Are you following the ./src/main and ./src/test directory structure? Or are you using something different?
  • Can you paste the output of the command mvn clean package --DskipTests=true && tree target? This should give a clear understanding exactly of what files are missing.

Upvotes: 1

Hongda Zhao
Hongda Zhao

Reputation: 101

Are you following the steps like http://docs.aws.amazon.com/devicefarm/latest/developerguide/test-types-android-appium-java-junit.html to create your zip file?

If no, what's the file/folder structure in your zip file?

If yes, could you please mail/PM the url for your failed test run? Then we could take a close look.

Upvotes: 0

Related Questions