DEVICE FARM , APPIUM , JAVA

482 views Asked by At

I have test cases written in JAVA and the project is not a TESTNG or JUnit. I want to run my testcases on Device Farm. I hav a jar file which has dependency on 3 properties file.

1

There are 1 answers

0
NikofTime On

I work for the AWS Device Farm team.

There are two ways to achieve this:

  1. Wrap you regular java classes test method calls inside TestNG calls. You can follow the sample example we host on github: https://github.com/awslabs/aws-device-farm-appium-tests-for-sample-app .

    Once you have those wrapped then you can annotate the test methods using @Test and device farm will be able to pick those up.

  2. The second way could be to try and see if you can run your Java test cases using a testNG runner. if that works locally it should work on device farm.

    A sample execution locally could look like:

    java -cp :/tmp/wd/:/tmp/wd/dependency-jars/ org.testng.TestNG /tmp/wd/yourjavatestclasses-SNAPSHOT-tests.jar outfile

Of course both these methods above would need you to package your test cases as per our instructions here: http://docs.aws.amazon.com/devicefarm/latest/developerguide/test-types-android-appium-java-testng.html