0

I currently trying out Amazon Device Farm and was able to get a dummy app to work.

However, when I tried getting the actual App I want to get working on Amazon device farm, I'm unable to do so. I'm able to upload the .ipa file, and zip up and upload the py.tests/appium tests with their dependencies, however the tests fail.

What I think might be happening is ADF is not recognizing some of the Desired_capabilities to autodismiss the Alerts for Notifications and GPS coordinates.

My setup is very similar to the setup I used with the dummy app in my initial tests. (these worked with amazon device farm) https://github.com/dlai0001/appium-spike-running-tests-oncloud

Only thing that is really different is I'm using a real production app, where 2 alert windows popup upon launch. In Appium it will cause the test to crash if I don't have the autodismiss or autoaccept alerts enabled in the desired capabilities.

Harness 00:00.0 1295 Info Starting 00001 with device c00e8ab68437161b894395e438ba8935a672bac0
Harness 00:00.0 1295 Info Using test content version 0.1.0
Harness 00:00.1v1295 Info Using image version ami-778b7c17
David Lai
  • 814
  • 7
  • 13

1 Answers1

0

I work for the Amazon Device Farm team.

  1. It appears that you are relying on desired capabilities to dismiss the alert window. Currently, Device farm has support for a very limited set of desired capabilities namely app name, package name and osversion. These are available to the application without having the user required to set it.

  2. Appium runs with autoAcceptAlerts=true on Device Farm. This should handle the alert windows, if any, unless it is a system pop up which autoAcceptAlert cannot handle. You should check if your tests can handle the alert windows using autoAcceptAlerts=true with Appium pre launch mode locally. If it can handle it then device farm should behave the same way. Sometimes it may be the case that the alert window appears before the appium session is established in which case adding a delay can help.

  3. When you test is locally please use Appium version 1.4.16 since this is the version being used on device farm right now.

NikofTime
  • 729
  • 3
  • 4
  • Hi, thanks for your response. I'll try out adding more waits. The code is working on my side locally using appium 1.14.13 (downloaded from the appium site). I've also tried it using 1.14.16 on other 3rd party device farms on simulated devices. – David Lai Apr 13 '16 at 17:10
  • These are my desired capabilities. desired_caps = { "autoAcceptAlerts": True, # Set to auto accept dialogs to prevent blocking tests. "sendKeyStrategy": "grouped" } wd = webdriver.Remote('http://0.0.0.0:4723/wd/hub', desired_caps) wd.implicitly_wait(60) # Add a long wait to account for slowness or remote grids. – David Lai Apr 13 '16 at 17:11
  • You do not have to pass desired capabilities to have device farm run it. It already runs with autoAcceptAlert=true. It will not accept "sendKeyStrategy": "grouped" desired capabilities. Also a true measure of the timeouts would be on a real device. You mentioned you tested it against simulated devices? – NikofTime Apr 18 '16 at 22:35
  • I've tested it against simulated device locally. As far as I can tell, it seems like a system pop for Geolocation and Notification that appears before the app fully launches. I tried adding .switch_to.alert.dismiss() calls, however, it fails on the step of instantiating the RemoteWebdriver itself. – David Lai Apr 19 '16 at 22:44
  • As the tests are run against real devices on device farm can you check if you are seeing the same behavior on a real local device ? Results on a simulator can differ from real devices. Also are you using Appium 1.4.16 locally as this is the version being used on device farm currently. – NikofTime Apr 27 '16 at 22:33
  • If you found the answer please accept it so that others can benefit from it. – NikofTime Jun 06 '17 at 00:36