This folder contains examples for using up / download files from:
- Android real devices on the new Sauce Labs UI
- Android real devices on the Legacy RDC cloud
- Android Emulators on the Sauce Labs Emulator cloud
- Android Emulator on the your local machine
NOTE:
Up/downloading files to iOS real devices is not supported by Appium!
Up/downloading files to Sauce Labs iOS Simulators is currently not supported by Sauce Labs
You can install all dependencies by running the following command
npm install
This will install all needed dependencies that are listed in the package.json
-file
NOTE:
Make sure you are in the folderup-download-file/appium
when you execute this command
The market of Android is being controlled by a lot of different vendors, this also means a lot of different file structures where to upload your file to or download the file from. This makes it a challenge to determine which folder on the device you need to have. You can check the location if you are using the Virtual USB offering of Sauce Labs for Private devices, see also this video.
The advice is that you use a dedicated device, so you always know the file structure and don't need to over complicate the up/downloading script.
For Android real devices we use the Samsung Gallery, and for Android emulators we use the Google Photos app. The purpose is not to show you how to automate these apps, but more to show you how you can verify if an upload was successful.
The examples in this repository that can run on Sauce Labs use environment variables, make sure you've added the following
# For Sauce Labs Real devices in the New UI
export SAUCE_USERNAME=********
export SAUCE_ACCESS_KEY=*******
# For the Legacy RDC
export SAUCE_RDC_EU_ACCESS_KEY_ANDROID=********
The script on how to use this can be found here and the execution will look like this
The script on how to use this can be found here and the execution will look like this
If you want to run the tests on Sauce Labs real devices in the New Sauce Labs UI then you can run the Android test with
// If using the US DC
npm run test.sauce.rdc.android.us
// If using the EU DC
npm run test.sauce.rdc.android.eu
The tests will be executed on a Samsung Galaxy 10.
See this config-file for more information.
If you want to run the tests on Sauce Labs real devices in the Legacy RDC then you can run the Android test with
// If using the US DC
npm run test.legacy.rdc.android.us
// If using the EU DC
npm run test.legacy.rdc.android.eu
The tests will be executed on a Samsung Galaxy 10.
See this config-file for more information.
If you want to run the tests on Sauce Labs Android Emulators then you can run the Android test with
// If using the US DC
npm run test.sauce.android.emulator.us
// If using the EU DC
npm run test.sauce.android.emulator.eu
The tests will be executed on a Android 8.1, 9.0 and 10.0.
See this config-file for more information.
If you want to run the tests on your local Android Emulator you can test this with
// If using the US DC
npm run test.local.android.emulator
Please check this config-file for more information.
This repo of examples is based on this article from Jonathan Lipps.