Setting up your machine
Testdroid Appium sample TestScripts are available in Python, Java, C# and Ruby. Appium tests are executed remotely from user's own machine, and the tests are executed on Testdroid Cloud in real time. Below is explained how to run your Python scripts locally from your machine.
Ensure you have Python 2.7.x or later is installed (should be pre-installed on OS X)
$ python --version
You can Install Python on Linux as follows
$ sudo apt-get install python2.7
To install Python on Windows, download and run setup from python.org download centre
Make sure to restart the command prompt for new environment variables to come in effect.
Check if Python's package installer 'pip' is already installed.
$ pip --version
$ curl https://raw.githubusercontent.com/pypa/pip/master/contrib/get-pip.py > get-pip.py
$ sudo python get-pip.py
$ rm get-pip.py
$ sudo apt-get install python-pip
$ curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py > get-pip.py
$ python get-pip.py
$ del get-pip.py
Install Python ‘selenium’ module
$ pip install selenium
Running the TestScript
curl -s -F result=@"/absolute/file/path/TestOutput.xml" "http://appium.testdroid.com/upload/result?sessionId=<sessionId>"
Clone the Testdroid Appium Sample TestScripts from Github. It contains sample apps for iOS and Android and sample iOS and Android app tests too. The samples directory contains more detailed steps on how to use the sample scripts.
Step 0: Upload you app to cloud
To upload your app to Testdroid Cloud use the following curl-script:
$ curl -s --user 'firstname.lastname@example.org:password' -F myAppFile=@"/path/to/app/file.apk" http://appium.testdroid.com/upload
Step 1: Set credentials and other parameters
Open the TestScript testdroid_ios.py in any text editor.
Set the screenshotDir to path where you want the screenshots to be saved in at your machine.
Set your credentials against testdroid_username and testdroid_password Desired Capabilities.
Set the myAppFile identifier from Step 0 against testdroid_app Desired Capability.
Details on all testdroid_ Desired Capabilities can be found here, but you can use default values for now.
Step 2: Run the TestScript
$ python testdroid_ios.py
The output should look like
Step 3 (optional): Upload your Test Suite output to Cloud
If your test suite generates a JUnit XML results file, you can upload the XML to Cloud. Doing this will show the test-cases and their statuses on the Web UI, and let you download test reports.
> Add the testdroid_junitWaitTime Desired Capability in your TestScript.
> Get Appium sessionId from your script (after the WebDriver connection has been established) using: driver.session_id
> After your test run has finished, and JUnit XML has been generated, use Curl to upload the XML to Cloud:
Step 4: Get results from Testdroid Cloud
The screenshots are available locally on your machine inside the directory you specified in Step 1.
Log into https://cloud.testdroid.com and navigate to project name as defined in testdroid_project Desired Capability to get the following log files.
1. Appium server log
2. Logcat / Instruments log