Skip to content

Appium Java Cucumber test scenarios are not executing in the AWS Device Farm

0

Hi Team,

I'm currently trying to execute Appium automated test scenarios on AWS device farm. There are no errors in the log, but no test scenario executed. I have included the testng.xml file which refers to the TestRunner class.

[DEVICEFARM] Setting up your device. This usually takes 2-3 minutes.
[DEVICEFARM] ########### Start executing testspec ###########
 
 
[DEVICEFARM] ########### Entering phase install ###########
 
[DeviceFarm] export APPIUM_VERSION=1.14.2
[DeviceFarm] avm $APPIUM_VERSION
/usr/bin/avm: line 261: appium: command not found
      exists : 
[DeviceFarm] ln -s /usr/local/avm/versions/$APPIUM_VERSION/node_modules/.bin/appium  /usr/local/avm/versions/$APPIUM_VERSION/node_modules/appium/bin/appium.js
 
[DEVICEFARM] ########### Entering phase pre_test ###########
 
[DeviceFarm] export CLASSPATH=$CLASSPATH:$DEVICEFARM_TESTNG_JAR
[DeviceFarm] export CLASSPATH=$CLASSPATH:$DEVICEFARM_TEST_PACKAGE_PATH/*
[DeviceFarm] export CLASSPATH=$CLASSPATH:$DEVICEFARM_TEST_PACKAGE_PATH/dependency-jars/*
[DeviceFarm] echo "Start appium server"
Start appium server
[DeviceFarm] appium --log-timestamp --default-capabilities "{\"deviceName\": \"$DEVICEFARM_DEVICE_NAME\", \"platformName\":\"$DEVICEFARM_DEVICE_PLATFORM_NAME\", \"app\":\"$DEVICEFARM_APP_PATH\", \"udid\":\"$DEVICEFARM_DEVICE_UDID\", \"platformVersion\":\"$DEVICEFARM_DEVICE_OS_VERSION\", \"chromedriverExecutable\":\"$DEVICEFARM_CHROMEDRIVER_EXECUTABLE\"}" >> $DEVICEFARM_LOG_DIR/appiumlog.txt 2>&1 &
[DeviceFarm] start_appium_timeout=0; while [ true ]; do
    if [ $start_appium_timeout -gt 60 ];
    then
        echo "appium server never started in 60 seconds. Exiting";
        exit 1;
    fi;
    grep -i "Appium REST http interface listener started on 0.0.0.0:4723" $DEVICEFARM_LOG_DIR/appiumlog.txt >> /dev/null 2>&1;
    if [ $? -eq 0 ];
    then
        echo "Appium REST http interface listener started on 0.0.0.0:4723";
        break;
    else
        echo "Waiting for appium server to start. Sleeping for 1 second";
        sleep 1;
        start_appium_timeout=$((start_appium_timeout+1));
    fi;
done;
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Waiting for appium server to start. Sleeping for 1 second
Appium REST http interface listener started on 0.0.0.0:4723
 
[DEVICEFARM] ########### Entering phase test ###########
 
[DeviceFarm] echo "Navigate to test package directory"
Navigate to test package directory
[DeviceFarm] cd $DEVICEFARM_TEST_PACKAGE_PATH
[DeviceFarm] echo "Start Appium JUnit test"
Start Appium JUnit test
[DeviceFarm] java -Dappium.screenshots.dir=$DEVICEFARM_SCREENSHOT_PATH org.testng.TestNG -junit -testjar *-tests.jar -d $DEVICEFARM_LOG_DIR/test-output
[TestNG] Running:
  /tmp/scratch5Hh0UX.scratch/test-packagezOobaa/testng.xml


===============================================
Regression
Total tests run: 0, Failures: 0, Skips: 0
===============================================

 
[DEVICEFARM] ########### Entering phase post_test ###########
 
 
[DEVICEFARM] ########### Finish executing testspec ###########
 
[DEVICEFARM] ########### Setting upload permissions ###########
 
 
[DEVICEFARM] Tearing down your device. Your tests report will come shortly.

https://us-west-2.console.aws.amazon.com/devicefarm/home?region=us-east-2#/mobile/projects/679dd7ea-c057-48a9-9fa6-cb581cf8133a/runs/716ddf89-b27a-4310-aecf-5eda2f2d7ac2/jobs/00000

Appreciate your help on this issue.

Regards, Wathsala.

asked 4 years ago1.8K views
1 Answer
0

Hello Wathsala. Sorry to hear about your issues with Appium on AWS Device Farm. Let's address this issue step by step:

Identify the problem: The Appium server is starting correctly, but no test scenarios are being executed. This could be due to various reasons, such as test configuration issues, incorrect test package structure, or incompatible dependencies.

Verify test package structure: Ensure your test package follows the correct structure for Appium tests on AWS Device Farm. This includes: A 'tests' directory containing your test files A 'dependency-jars' directory with necessary JAR files At least one '-tests.jar' file in the package

Check test file naming: Verify that your test files have names starting or ending with 'test'. AWS Device Farm uses this naming convention to identify test files.

Review dependencies: Ensure all required dependencies are included in your test package and are compatible with AWS Device Farm. Pay special attention to the JUnit or TestNG version, which should be at least 4.10 for JUnit.

Examine test configuration: Review your test configuration in AWS Device Farm to ensure it matches your test package and requirements.

Check for silent failures: Although there are no visible errors in the log, there might be silent failures. Review the complete test logs for any warnings or errors that might indicate why the tests aren't running.

Verify Appium version compatibility: Ensure the Appium version you're using is compatible with AWS Device Farm. Check the AWS Device Farm documentation for supported Appium versions.

Test locally: Try running your tests locally to ensure they execute correctly outside of AWS Device Farm. This can help isolate whether the issue is with your tests or the Device Farm environment.

Increase logging verbosity: If possible, increase the logging verbosity in your test configuration to get more detailed information about what's happening during the test execution phase.

Check device compatibility: Ensure the devices you've selected in AWS Device Farm are compatible with your application and test scenarios.

If the problem persists after trying these steps, I recommend:

  1. Double-checking the AWS Device Farm documentation for any recent changes or known issues.
  2. Reviewing AWS Device Farm forums or AWS re:Post for similar issues and potential solutions.
  3. If you're still unable to resolve the issue, consider opening a support ticket with AWS for more personalized assistance.

To verify that your problem has been solved, you should see your test scenarios executing and completing in the AWS Device Farm console, with detailed logs and results available for review.

Additional Resources:

https://docs.aws.amazon.com/devicefarm/latest/developerguide/troubleshooting-appium-java-junit.html

https://docs.aws.amazon.com/devicefarm/latest/developerguide/troubleshooting-appium-python.html

https://docs.aws.amazon.com/devicefarm/latest/developerguide/troubleshooting-appium-web-python.html

Best of luck and thank you for using AWS!

Brian

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.