By using AWS re:Post, you agree to the Terms of Use

Questions tagged with Front-End Web & Mobile

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

0
answers
0
votes
27
views
asked 6 months ago

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

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.
0
answers
0
votes
22
views
asked 6 months ago

Appium Java tests are not running in the AWS Device Farm

Hello Guys, I am trying to run the appium automated tests with device farm. However, my tests are not running and failing with the below error. ``` [TestNG] RUNNING: Suite: "Command line test 41826786-55ed-4502-bf04-08c38bd76f95" containing "17" Tests (config: null) [Invoker 254801937] Keeping method AndroidBaseTest.setUpAndroidApp(org.testng.ITestContext)[pri:0, instance:mobile.androidapp.androidnativedemo.ApiDemoTestAndroid@32d2fa64] for class [TestClass name=class mobile.androidapp.androidnativedemo.ApiDemoTestAndroid] [Invoker 254801937] Invoking @BeforeClass AndroidBaseTest.setUpAndroidApp(org.testng.ITestContext)[pri:0, instance:mobile.androidapp.androidnativedemo.ApiDemoTestAndroid@32d2fa64] [TestNG] INVOKING CONFIGURATION: "Command line test 41826786-55ed-4502-bf04-08c38bd76f95" - @BeforeClass mobile.androidapp.common.AndroidBaseTest.setUpAndroidApp(org.testng.ITestContext)(value(s): org.testng.TestRunner@71c3b41) Failed to invoke configuration method mobile.androidapp.common.AndroidBaseTest.setUpAndroidApp:The main Appium script does not exist at '/usr/lib/node_modules/appium/build/lib/main.js' [TestNG] FAILED CONFIGURATION: "Command line test 41826786-55ed-4502-bf04-08c38bd76f95" - @BeforeClass mobile.androidapp.common.AndroidBaseTest.setUpAndroidApp(org.testng.ITestContext)(value(s): org.testng.TestRunner@71c3b41) finished in 0 ms [TestNG] io.appium.java_client.service.local.InvalidServerInstanceException: The main Appium script does not exist at '/usr/lib/node_modules/appium/build/lib/main.js' ``` Custom environment yaml file: ``` version: 0.1 phases: install: commands: - export APPIUM_VERSION=1.18.0 - avm $APPIUM_VERSION - ln -s /usr/local/avm/versions/$APPIUM_VERSION/node_modules/.bin/appium /usr/local/avm/versions/$APPIUM_VERSION/node_modules/appium/bin/appium.js pre_test: commands: - export CLASSPATH=$CLASSPATH:$DEVICEFARM_TESTNG_JAR - export CLASSPATH=$CLASSPATH:$DEVICEFARM_TEST_PACKAGE_PATH/* - export CLASSPATH=$CLASSPATH:$DEVICEFARM_TEST_PACKAGE_PATH/dependency-jars/* - echo "Start appium server" - >- appium --log-timestamp --log-level debug:error --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 & - >- 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; test: commands: - echo "Navigate to test package directory" - cd $DEVICEFARM_TEST_PACKAGE_PATH - echo "Start Appium TestNG test" - ls -ltr - which appium - echo $JAVA_HOME - which node - node -v - appium -v - java -Dappium.screenshots.dir=$DEVICEFARM_SCREENSHOT_PATH org.testng.TestNG -testjar *-tests.jar -d $DEVICEFARM_LOG_DIR/test-output -verbose 10 post_test: commands: artifacts: # By default, Device Farm will collect your artifacts from following directories - $DEVICEFARM_LOG_DIR ``` https://us-west-2.console.aws.amazon.com/devicefarm/home?region=us-east-1#/mobile/projects/e7d85810-369a-443b-ac29-86ab38065b81/runs/2277ddb7-82ce-4aa5-8d40-3454f1baa009/jobs/00000 Could someone help me ? Regards, Sekar
1
answers
0
votes
146
views
asked 7 months ago

Appium Java Test NG tests are not running in the AWS Device Farm

Hello Guys, I am trying to run the appium Test NG automated tests using teng.xml file with device farm. However, my tests are not running after unzipping the tests.jar file. There is no error in the log file, so I am unable to find out the reason. Custom environment yaml file: ``` version: 0.1 phases: install: commands: # This test execution environment uses Appium version 1.9.1 by default, however we enable you to change it using the Appium version manager (avm). An - export APPIUM_VERSION=1.18.0 - avm $APPIUM_VERSION - ln -s /usr/local/avm/versions/$APPIUM_VERSION/node_modules/.bin/appium /usr/local/avm/versions/$APPIUM_VERSION/node_modules/appium/bin/appium.js # The pre-test phase includes commands that setup your test environment. pre_test: commands: # Setup environment variables for java - export CLASSPATH=$CLASSPATH:$DEVICEFARM_TESTNG_JAR - export CLASSPATH=$CLASSPATH:$DEVICEFARM_TEST_PACKAGE_PATH/* - export CLASSPATH=$CLASSPATH:$DEVICEFARM_TEST_PACKAGE_PATH/dependency-jars/* - echo "Start appium server" - >- 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 & - >- 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; test: commands: # Your test package is downloaded in $DEVICEFARM_TEST_PACKAGE_PATH so we first change directory to that path. - echo "Navigate to test package directory" - cd $DEVICEFARM_TEST_PACKAGE_PATH # 1. Your testng.xml is inside the test jar after packaging step. Unzip it using commands: - echo "Unzipping TestNG tests jar" - unzip *-tests.jar # 2. Run your TestSuite by specifying the unzipped testng.xml using commands: - ls -ltr - which appium - appium -v - pwd - node -v - appium -v - which node - echo $DEVICEFARM_LOG_DIR - echo "Start Appium TestNG test" - java org.testng.TestNG -d $DEVICEFARM_LOG_DIR/test-output testng_android.xml ``` Error Log: ``` [DeviceFarm] echo "Start Appium TestNG test" Start Appium TestNG test [DeviceFarm] java org.testng.TestNG -d $DEVICEFARM_LOG_DIR/test-output testng_android.xml log4j:WARN No appenders could be found for logger (mobile.common.filereader.ConfigFileReaderUtils). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. [TestNG] Running: /tmp/scratchDVpVKr.scratch/test-packagemJj_ph/testng_android.xml =============================================== Android Regression Tests Total tests run: 2, Failures: 0, Skips: 2 Configuration Failures: 2, Skips: 1 =============================================== ``` https://us-west-2.console.aws.amazon.com/devicefarm/home?region=us-east-1#/mobile/projects/e7d85810-369a-443b-ac29-86ab38065b81/runs/6d8ad0d2-394c-4de5-898a-eed8e816745c/jobs/00000 Could someone please help me out ? Regards, Sekar
3
answers
0
votes
95
views
asked 7 months ago