Sample repo to run app automation on real device on LambdaTest
Before you can start performing App automation testing with Appium, you would need to follow these steps:
- Install the latest Python build from the official website. We recommend using the latest version.
- Make sure pip is installed in your system. You can install pip from here.
Step-1: Clone the LambdaTest's LT-appium-python and navigate to the code directory as shown below:
git clone https://github.com/LambdaTest/LT-appium-python
cd LT-appium-python
Make sure you have your LambdaTest credentials with you to run test automation scripts on LambdaTest. To obtain your access credentials, purchase a plan or access the Automation Dashboard.
Step-2: Set LambdaTest Username
and Access Key
in environment variables.
export LT_USERNAME="YOUR_LAMBDATEST_USERNAME"
export LT_ACCESS_KEY="YOUR_LAMBDATEST_ACCESS_KEY"
Step-3: Upload your iOS application (.ipa file) or android application (.apk file) to the LambdaTest servers using our REST API. You need to provide your Username and AccessKey in the format Username:AccessKey
in the cURL command for authentication. Make sure to add the path of the appFile in the cURL request. Here is an example cURL request to upload your app using our REST API:
curl -u "YOUR_LAMBDATEST_USERNAME":"YOUR_LAMBDATEST_ACCESS_KEY" \
--location --request POST 'https://manual-api.lambdatest.com/app/upload/realDevice' \
--form 'name="Android_App"' \
--form 'appFile=@"/Users/macuser/Downloads/proverbial_android.apk"'
Note:
- If you do not have any .apk or .ipa file, you can run your sample tests on LambdaTest by using our sample Android app or sample iOS app.
- Response of above cURL will be a JSON object containing the
App URL
of the format - lt://APP123456789123456789 and will be used in the next step.
Step-4: Run the following command in the directory where your project has been saved to execute your build.
python3 ios.py
python3 android.py
Your test results would be displayed on the test console (or command-line interface if you are using terminal/cmd) and on the LambdaTest App Automation Dashboard.