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

Questions tagged with AWS Device Farm

Sort by most recent

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

AWS Device Farm: Not able to change context to webview

Hi, I am writing test for a hybrid Android app using Appium Nodejs with WebDriverIO. I am able to test the native screens well. I am not able to change context to webview. The code to change context looks as follows var ctxs1 = await client.getContexts(); console.log("Available Contexts in fitBitLogin-----"); console.log(ctxs1); ctxs1.every(async function(value, index, array) { if(value.includes('WEBVIEW')) { await client.switchContext(value); return false; } return true; }) The following are the logs. You can see that both native and webview contexts are available. But changing the context to webview is failing. 2022-10-01T19:13:50.492Z INFO webdriver: COMMAND getContexts() 2022-10-01T19:13:50.492Z INFO webdriver: [GET] http://127.0.0.1:4723/wd/hub/session/d9377f5a-50d8-44db-9d09-f16f92aaf511/contexts 2022-10-01T19:13:51.723Z INFO webdriver: RESULT [ 'NATIVE_APP', 'WEBVIEW_chrome' ] Available Contexts in fitBitLogin----- [ 'NATIVE_APP', 'WEBVIEW_chrome' ] 2022-10-01T19:13:51.723Z INFO webdriver: COMMAND switchContext("WEBVIEW_chrome") 2022-10-01T19:13:51.724Z INFO webdriver: [POST] http://127.0.0.1:4723/wd/hub/session/d9377f5a-50d8-44db-9d09-f16f92aaf511/context 2022-10-01T19:13:51.724Z INFO webdriver: DATA { name: 'WEBVIEW_chrome' } 2022-10-01T19:14:16.728Z INFO webdriver: COMMAND findElement("xpath", "//*[@id='ember654']") 2022-10-01T19:14:16.728Z INFO webdriver: [POST] http://127.0.0.1:4723/wd/hub/session/d9377f5a-50d8-44db-9d09-f16f92aaf511/element 2022-10-01T19:14:16.728Z INFO webdriver: DATA { using: 'xpath', value: "//*[@id='ember654']" } 2022-10-01T19:15:03.858Z WARN webdriver: Request failed with status 500 due to An unknown server-side error occurred while processing the command. Original error: Process didn't end after 10000ms (cmd: '/opt/chromedriver/linux/65/chromedriver --url-base\=wd/hub --port\=8000 --adb-port\=5037 --verbose') Please note, on my local machine, with an Android emulator, the test works without any issues. Any guidance/help will be very useful. Do let me know if you need more inputs. Thanks!
0
answers
0
votes
7
views
asked 3 days ago

java.lang.IllegalArgumentException: path must exist: /tmp/scratchyaEyhw.scratch/test-package04aCEg/src/test/resources/MobileFeatures getting this error unable to run cucumber framework,please help?

[DEVICEFARM] Setting up your device. This usually takes 2-3 minutes. [DEVICEFARM] ########### Start executing testspec ########### [DEVICEFARM] ########### Entering phase install ########### [DeviceFarm] export NVM_DIR=$HOME/.nvm [DeviceFarm] . $NVM_DIR/nvm.sh [DeviceFarm] nvm install 14.19.1 v14.19.1 is already installed. Now using node v14.19.1 (npm v6.14.16) [DeviceFarm] export APPIUM_VERSION=1.22.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 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 TestNG test" Start Appium TestNG test [DeviceFarm] java -Dappium.screenshots.dir=$DEVICEFARM_SCREENSHOT_PATH org.testng.TestNG -testjar *-tests.jar -d $DEVICEFARM_LOG_DIR/test-output -verbose 10 [TestRunner] Running the tests in 'Test' with parallel mode:none [RunInfo] Adding method selector: org.testng.internal.XmlMethodSelector@dd3b207 priority: 10 [TestClass] Creating TestClass for [ClassImpl class=cucumberOptions.TestNGTest] [TestClass] Adding method AbstractTestNGCucumberTests.runScenario(io.cucumber.testng.PickleWrapper, io.cucumber.testng.FeatureWrapper)[pri:0, instance:null] on TestClass class cucumberOptions.TestNGTest [XmlMethodSelector] Including method io.cucumber.testng.runScenario() [TestNG] Running: /tmp/scratchyaEyhw.scratch/test-package04aCEg/testng.xml [SuiteRunner] Created 1 TestRunners [TestRunner] Running test Test on 1 classes, included groups:[] excluded groups:[] ===== Test class cucumberOptions.TestNGTest @BeforeClass AbstractTestNGCucumberTests.setUpClass(org.testng.ITestContext)[pri:0, instance:cucumberOptions.TestNGTest@20d3d15a] @Test AbstractTestNGCucumberTests.runScenario(io.cucumber.testng.PickleWrapper, io.cucumber.testng.FeatureWrapper)[pri:0, instance:cucumberOptions.TestNGTest@20d3d15a] @AfterClass AbstractTestNGCucumberTests.tearDownClass()[pri:0, instance:cucumberOptions.TestNGTest@20d3d15a] ====== [TestNG] RUNNING: Suite: "Test" containing "1" Tests (config: /tmp/scratchyaEyhw.scratch/test-package04aCEg/testng.xml) [Invoker 102065302] Keeping method AbstractTestNGCucumberTests.setUpClass(org.testng.ITestContext)[pri:0, instance:cucumberOptions.TestNGTest@20d3d15a] for class [TestClass name=class cucumberOptions.TestNGTest] [Invoker 102065302] Invoking @BeforeClass AbstractTestNGCucumberTests.setUpClass(org.testng.ITestContext)[pri:0, instance:cucumberOptions.TestNGTest@20d3d15a] =============================================== Test Tests run: 0, Failures: 0, Skips: 0 Configuration Failures: 1, Skips: 0 =============================================== [TestNG] [TestNG] =============================================== [TestNG] Test[TestNG] INVOKING CONFIGURATION: "Test" - @BeforeClass io.cucumber.testng.AbstractTestNGCucumberTests.setUpClass(org.testng.ITestContext)(value(s): org.testng.TestRunner@19d37183) Failed to invoke configuration method io.cucumber.testng.AbstractTestNGCucumberTests.setUpClass:path must exist: /tmp/scratchyaEyhw.scratch/test-package04aCEg/src/test/resources/MobileFeatures/Features/EarlysalaryQECjourney.feature [TestNG] FAILED CONFIGURATION: "Test" - @BeforeClass io.cucumber.testng.AbstractTestNGCucumberTests.setUpClass(org.testng.ITestContext)(value(s): org.testng.TestRunner@19d37183) finished in 0 ms [TestNG] java.lang.IllegalArgumentException: path must exist: /tmp/scratchyaEyhw.scratch/test-package04aCEg/src/test/resources/MobileFeatures/Features/EarlysalaryQECjourney.feature [TestNG] at io.cucumber.core.resource.PathScanner.findResourcesForPath(PathScanner.java:49) [TestNG] at io.cucumber.core.resource.PathScanner.findResourcesForUri(PathScanner.java:31) [TestNG] at io.cucumber.core.resource.ResourceScanner.findResourcesForUri(ResourceScanner.java:61) [TestNG] at io.cucumber.core.resource.ResourceScanner.scanForResourcesUri(ResourceScanner.java:134) [TestNG] at io.cucumber.core.runtime.FeaturePathFeatureSupplier.loadFeatures(FeaturePathFeatureSupplier.java:62) [TestNG] at io.cucumber.core.runtime.FeaturePathFeatureSupplier.get(FeaturePathFeatureSupplier.java:45) [TestNG] at io.cucumber.testng.TestNGCucumberRunner.<init>(TestNGCucumberRunner.java:122) [TestNG] at io.cucumber.testng.AbstractTestNGCucumberTests.setUpClass(AbstractTestNGCucumberTests.java:27) [TestNG] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [TestNG] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [TestNG] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [TestNG] at java.lang.reflect.Method.invoke(Method.java:498) [TestNG] at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84) [TestNG] at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564) [TestNG] at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213) [TestNG] at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138) [TestNG] at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:175) [TestNG] at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:107) [TestNG] at org.testng.TestRunner.privateRun(TestRunner.java:767) [TestNG] at org.testng.TestRunner.run(TestRunner.java:617) [TestNG] at org.testng.SuiteRunner.runTest(SuiteRunner.java:348) [TestNG] at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343) [TestNG] at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305) [TestNG] at org.testng.SuiteRunner.run(SuiteRunner.java:254) [TestNG] at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) [TestNG] at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) [TestNG] at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224) [TestNG] at org.testng.TestNG.runSuitesLocally(TestNG.java:1149) [TestNG] at org.testng.TestNG.run(TestNG.java:1057) [TestNG] at org.testng.TestNG.privateMain(TestNG.java:1364) [TestNG] at org.testng.TestNG.main(TestNG.java:1333) [Invoker 102065302] Keeping method AbstractTestNGCucumberTests.tearDownClass()[pri:0, instance:cucumberOptions.TestNGTest@20d3d15a] for class [TestClass name=class cucumberOptions.TestNGTest] [Invoker 102065302] Invoking @AfterClass AbstractTestNGCucumberTests.tearDownClass()[pri:0, instance:cucumberOptions.TestNGTest@20d3d15a] [TestNG] INVOKING CONFIGURATION: "Test" - @AfterClass io.cucumber.testng.AbstractTestNGCucumberTests.tearDownClass() [TestNG] PASSED CONFIGURATION: "Test" - @AfterClass io.cucumber.testng.AbstractTestNGCucumberTests.tearDownClass() finished in 0 ms ===== Invoked methods AbstractTestNGCucumberTests.setUpClass(org.testng.ITestContext)[pri:0, instance:cucumberOptions.TestNGTest@20d3d15a]org.testng.TestRunner@19d37183 550752602 AbstractTestNGCucumberTests.tearDownClass()[pri:0, instance:cucumberOptions.TestNGTest@20d3d15a] 550752602 ===== Creating /tmp/customer_log_directoryZc6WXr/test-output/Suite/Test.html Creating /tmp/customer_log_directoryZc6WXr/test-output/Suite/Test.xml FAILED CONFIGURATION: @BeforeClass setUpClass(org.testng.TestRunner@19d37183) java.lang.IllegalArgumentException: path must exist: /tmp/scratchyaEyhw.scratch/test-package04aCEg/src/test/resources/MobileFeatures/Features/EarlysalaryQECjourney.feature at io.cucumber.core.resource.PathScanner.findResourcesForPath(PathScanner.java:49) at io.cucumber.core.resource.PathScanner.findResourcesForUri(PathScanner.java:31) at io.cucumber.core.resource.ResourceScanner.findResourcesForUri(ResourceScanner.java:61) at io.cucumber.core.resource.ResourceScanner.scanForResourcesUri(ResourceScanner.java:134) at io.cucumber.core.runtime.FeaturePathFeatureSupplier.loadFeatures(FeaturePathFeatureSupplier.java:62) at io.cucumber.core.runtime.FeaturePathFeatureSupplier.get(FeaturePathFeatureSupplier.java:45) at io.cucumber.testng.TestNGCucumberRunner.<init>(TestNGCucumberRunner.java:122) at io.cucumber.testng.AbstractTestNGCucumberTests.setUpClass(AbstractTestNGCucumberTests.java:27) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138) at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:175) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:107) at org.testng.TestRunner.privateRun(TestRunner.java:767) at org.testng.TestRunner.run(TestRunner.java:617) at org.testng.SuiteRunner.runTest(SuiteRunner.java:348) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:343) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:305) at org.testng.SuiteRunner.run(SuiteRunner.java:254) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224) at org.testng.TestNG.runSuitesLocally(TestNG.java:1149) at org.testng.TestNG.run(TestNG.java:1057) at org.testng.TestNG.privateMain(TestNG.java:1364) at org.testng.TestNG.main(TestNG.java:1333) [TestNG] Tests run: 0, Failures: 0, Skips: 0 [TestNG] Configuration Failures: 1, Skips: 0 [TestNG] =============================================== =============================================== Suite Total tests run: 0, Failures: 0, Skips: 0 Configuration Failures: 1, Skips: 0 =============================================== [TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 1 ms Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/toc.html Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/Test.properties Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/index.html Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/main.html Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/groups.html Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/methods.html Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/methods.html Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/methods.html Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/methods.html Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/methods-alphabetical.html Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/methods-alphabetical.html Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/methods-alphabetical.html Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/methods-alphabetical.html Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/classes.html Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/reporter-output.html Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/methods-not-run.html Creating /tmp/customer_log_directoryZc6WXr/test-output/old/Suite/testng.xml.html Creating /tmp/customer_log_directoryZc6WXr/test-output/old/index.html [TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@2df32bf7: 14 ms [TestNG] Time taken by org.testng.reporters.JUnitReportReporter@32cf48b7: 1 ms [TestNG] Time taken by org.testng.reporters.jq.Main@3bd94634: 22 ms [TestNG] Time taken by org.testng.reporters.XMLReporter@7181ae3f: 3 ms [TestNG] Time taken by org.testng.reporters.EmailableReporter2@1ee807c6: 5 ms [DEVICEFARM] ########### Entering phase post_test ########### [DEVICEFARM] ########### Finish executing testspec ########### [DEVICEFARM] ########### Setting upload permissions ########### [DEVICEFARM] Tearing down your device. Your tests report will come shortly.
1
answers
0
votes
33
views
asked 3 months ago