By using AWS re:Post, you agree to the Terms of Use
/Front-End Web & Mobile/

Questions tagged with Front-End Web & Mobile

Sort by most recent
  • 1
  • 90 / page

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

Webdriver testcases are failing while setting connection

Trying to deploy a basic webdriver.io + nodejs test on devicefarm but always for ios device test cases are getting stuck at Testcase is failing: job arn: arn:aws:devicefarm:us-west-2:612756076442:job:02bd6c95-640d-43b3-82eb-6f618777ac73/1a6364f3-7528-44b1-afa1-d6c2dc51d881/00000 ``` 2022-05-04T22:40:58.353Z ERROR @wdio/runner: Error: Failed to create session. [0-0] Unable to connect to "http://localhost:4723/", make sure browser driver is running on that address. [0-0] If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver. [0-0] at startWebDriverSession (/private/tmp/scratchY4h2F6.scratch/test-packagex5aknf/node_modules/integration/node_modules/webdriver/build/utils.js:72:15) [0-0] at process.processTicksAndRejections (node:internal/process/task_queues:95:5) [0-0] at async Function.newSession (/private/tmp/scratchY4h2F6.scratch/test-packagex5aknf/node_modules/integration/node_modules/webdriver/build/index.js:46:45) [0-0] at async remote (/private/tmp/scratchY4h2F6.scratch/test-packagex5aknf/node_modules/integration/node_modules/webdriverio/build/index.js:77:22) [0-0] at async Runner._startSession (/private/tmp/scratchY4h2F6.scratch/test-packagex5aknf/node_modules/integration/node_modules/@wdio/runner/build/index.js:223:56) ``` and for android testcases is asking for node version greater than 12 (after adding nvm install 18.1.0 in yaml)
0
answers
0
votes
1
views
asked 14 days ago
0
answers
0
votes
2
views
asked a month 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
2
views
asked 2 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
11
views
asked 2 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
6
views
asked 2 months ago

Best setup to broadcast live stream (video+chat) from webcam

I'm looking to build out web-based live streaming capabilities & video chat client for my application, similar to the twitch but not as heavy or highly trafficked. While I've looked at some of the many services offered by AWS, there's just so many (MediaLive, IVS, Kinesis etc) that it's hard to know which service or combo of services would be the best fit and so I'm looking for some general guidance from anyone who has experience setting this up, or if there are existing guides that may be of help. In general, here are my requirements - Broadcasters should be able to broadcast via their webcam/media device in the browser (ie. via getUserMedia) - Broadcasts will be 1 to many, with only the broadcaster streaming video and likely an average of 20-30 audience members consuming the stream - Audience members would use a separate front end client, which should also be web based - I would like to be able to include a user/chat function, so that users can chat globally, thus will need live 2-way data stream capabilities, but not sure if this is best handled by the media streaming service itself, web sockets, WebRTC etc I could possibly utilize existing JS libraries to capture media as well as a viewing/chat application or even develop my own, but I'm also wondering if there are AWS recommended JS libraries or guides that can aid in this as well. hope someone can help me get started, thanks!
1
answers
0
votes
10
views
asked 4 months ago
1
answers
0
votes
106
views
asked 4 months ago

Restrict Access to Webpage with Amplify & Cognito

I am looking to restrict access to a basic html, css, javascript web application (simple web map). I have not integrated amplify auth library with my web app. I uploaded my application to Amplify and it fetches the index.html file to display the map (https://main.d3ungex01leet7.amplifyapp.com). My goal is to restrict access to this web map/application only to users who are logged in. I have followed the instructions in this aws tutorial https://www.youtube.com/watch?v=oFSU6rhFETk (Secure your API Gateway with Amazon Cognito Users Pools) which handles the code/token creation when a user logs in. I am using this link (https://main.d3ungex01leet7.amplifyapp.com) as my Callback URL in my cognito User Pool which gives me something like this when I login (https://main.d3ungex01leet7.amplifyapp.com/?code=d1c1e063-4094-4bd0-a110-12e895147533#3/37.09/-95.71). This works great and all, but when anyone enters in https://main.d3ungex01leet7.amplifyapp.com, it will bypass cognito and they will have access to the web map that I am trying to restrict via cognito. I am wondering if there is some javascript that I can add to my main html file that can extract the token out of the URL params and store it in a cookie/localstorage on the browser? Before the web app/map is loaded, it should check for the token in the browser's cookies and validate it. Once it is validated, the web app should fully load. If it is not validated, it should say something like "Access Denied" I have read this article https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-verifying-a-jwt.html but am having trouble understanding the process as it pertains to my specific situation.
1
answers
1
votes
75
views
asked 5 months ago
  • 1
  • 90 / page