I am testing an iOS mobile app on AWS Device farm that requires me to be able to select images from the iOS device. I cannot use the camera images on the device farm devices as they are dark and my testing requirement is to be able to use 'real' images. Is there a way to upload images to the iOS device/s that tests run on or easily add them to the devices as part of test setup? Thanks.
Asked
Active
Viewed 606 times
1 Answers
1
There is a way to add images to the app's bundle using the extra data feature of Device Farm.
The app should be able to access it using the bundle object and the file tree of the zip file uploaded to Device Farm. So the path to images would be something like: path/to/bundle/aatp/data/images
Assuming the zip uploaded has a directory called images
.
Hth -James

jmp
- 2,175
- 2
- 17
- 16
-
Thanks James.My question wasn't clear. My automated tests need to navigate to the camera roll on the iPhone and select a number of images. Some of the devices on AWS device farm have one or two blank images on them, others have none. Regardless I need a collection of 'real' images or photo's on the devices for my tests. – Chris B Aug 09 '18 at 13:09
-
Hmm, well once the images are on the device this may be possible to do through the app under test. https://stackoverflow.com/a/11131077/8016330 depending on the testing framework this might also be possible through the tests. For example, in the case of XC UI test an additional ipa file is deployed to the device which could be packaged with these images. Then some code that runs before the tests could then load these images. Is this solution applicable to the use case? – jmp Aug 09 '18 at 13:22
-
Great, that looks like an option to explore. Thanks. – Chris B Aug 09 '18 at 13:26
-
@jmp any solution for Android phones? I'm having the same problem. Even though I add images to the device using Extra Data feature, they don't show up in Gallery. I tried to push files to sdcard using Appium (which automatically refreshes the Gallery), but that's not working either on AWS device farm. I even tried adb's rescan broadcast in the test suite, but not luck. Locally it's working perfectly using an Android emulator. – Ervin Kalemi Jul 11 '19 at 10:25