Real Device Testing Home / Video /

How to Run Parallel Appium Tests on Real Android Devices (Video)

How to Run Parallel Appium Tests on Real Android Devices (Video)

...Playlist

...
  • Test Your Android And iOS Apps On Real Device Cloud of 3000+ Devices
  • How To Perform Automated App Testing On Real Devices💡| Appium Testing
  • How To Perform Real-Time Testing On Real Devices💡| Manual Testing |

About the Video

Automated App Testing allows you to test your native, hybrid, and web apps on the Appium mobile device cloud of 3000+ different real devices.

Video Chapters

0:00 Introduction to App Automation on real devices

0:21 Demonstration of Automated App Testing on Real Devices

2:01 How to get the User Name & Access Key for your TestMu AI account?

2:36 How to upload a mobile application to the TestMu AI platform for testing?

10:09 How to download Appium logs to your local machine?

10:29 Conclusion

Key Topics Covered

Introduction to Automated Mobile App Testing: The importance of testing on real devices for resource-intensive applications.

Navigating to TestMu AI: How to start with TestMu AI, including where to find documentation and getting started guides.

Setting Up for Testing: Prerequisites like having Appium's Java client library installed, and the necessity of a TestMu AI account plan.

Using Sample Mobile Applications for Testing: Access to sample applications and codebases provided in TestMu AI documentation for practice.

Uploading Mobile Applications to TestMu AI: Step-by-step guide on uploading applications using a curl command, with details on finding the access key and using it for authentication.

Executing Automated Tests: Detailed walkthrough of executing tests on TestMu AI, including setting up environment variables, defining desired capabilities, and using Appium driver for testing.

Reviewing Test Results: Explanation on how to review test outcomes, including screen recordings, screenshots, test logs, and more detailed logs like network or device logs.

Related Blogs & Hubs

Getting Started with Appium Testing on TestMu AI

Desired Capabilities In Appium To Run Automated Tests

Realtime Native Mobile App Testing

Real Device Cloud For Native App Testing

Mobile Web Automation Testing On Real Devices

Emulator vs Simulator vs Real Device Testing: Key Differences

Video Transcript

This video was recorded before LambdaTest became TestMu AI, so the speaker uses the LambdaTest name.

Hey, what's up, everybody? My name is Moss, and in this video, I'm going to demonstrate how to perform automated testing of your mobile application on real devices hosted on the LambdaTest platform. Among other benefits, testing on a real device is an ideal choice if your mobile application is resource intensive and requires a physical device to run optimally. Let's take a closer look at automated app testing on real devices.

So the first thing that I'm going to do is navigate to lambdatest.com, and before we get started with the demo, I'd like to show you where you can find the documentation that outlines the steps I'll be taking, in case you'd like to try this out yourself. From here, I'm going to navigate to Resources and then to Documentation. In the table of contents, I'm going to select Appium Testing and then select Getting Started.

The sample mobile application that I'll be using is available in the documentation under the note. In the prerequisites, you would also want to make sure that you have Appium's Java client library installed on your machine. And finally, you would need to have also purchased the associated plan for your LambdaTest account. In addition to sample mobile applications, this documentation also includes a codebase which can be used to execute the automated tests on the LambdaTest platform. That codebase is available in a GitHub repository that's linked here.

I'm going to navigate back to lambdatest.com and then to my LambdaTest dashboard. From the dashboard, I'm going to expand the left-hand side menu, and then I'll select Real Device, and then I'm going to select App Automation. The first thing that I'm going to need in order to execute tests is an access key for my LambdaTest account. You can find your access key by clicking on the key symbol in the top right of the page. This displays a window that includes the LambdaTest hub URL as well as your username and access key.

I've already added my access key as an environment variable on my machine. I've also downloaded the codebase and sample mobile application to my local machine. For the purposes of this demo, I downloaded a sample mobile application, but you likely already have a mobile application that you would like to test on the LambdaTest platform. In order to test your mobile application, you will need to upload it to the LambdaTest platform. To do so, I'm going to execute a simple curl command, and this curl command can be found in the documentation that I just referenced.

What I'm going to do is upload my mobile application using my username and LambdaTest account access key. The application will be posted to this endpoint. If needed, I can simply copy this command to my clipboard and then replace the relevant values with my username and access key, as well as the file path to the sample application on my local.

I'm going to navigate to my terminal in VS Code. I'm currently in the directory where the sample application is located. The mobile application is in the same directory as the sample codebase that will be used to execute tests on LambdaTest. I'll begin the process by uploading the proverbial_android.apk file to the LambdaTest platform, and I'll do so using the curl command that I showed you in the documentation.

As you can see in the curl command, I authenticate with LambdaTest using my username and access key that is set as an environment variable on my local machine. I then post the proverbial_android.apk file to this endpoint. After executing the curl command, LambdaTest responds with an app ID as well as an app URL, which I will use in the automation script. I'm going to copy the value of the app URL to my clipboard.

And then I'll open up my automation script called AndroidApp.java. In this file, we have the AndroidApp class, which is a test class that includes one test case called AndroidApp1. The first thing that I'm going to update in this file is my username. The script will grab the username environment variable if it's set, or I can hard code it here, which is what I will do. However, I will not hard code the access key, and I have stored the access key in an environment variable called LT_ACCESS_KEY.

Below the username and access key declarations, you can see the grid URL defined, which is set to the LambdaTest hub URL. If we scroll down to the AndroidApp1 test case, we can see that it's parameterized via TestNG. If I take a look at the TestNG XML file for Android, you can see that we have two tests defined: Android App Test 1 and Android App Test 2. One is parameterized with Galaxy S21 Ultra 5G, and then the other is parameterized with Galaxy S21.

Now, if I scroll down to where the desired capabilities are defined, you'll notice this setCapability called "app". The value of this capability should be set to the app URL that was returned by LambdaTest when we executed our curl command, so I'm going to go ahead and paste that app URL here.

Once the desired capabilities are defined, an Appium driver is initialized using the LambdaTest hub URL. After initializing the driver, the testing begins by clicking a button that changes the color of text. It then performs several more actions inside of the sample mobile application before finishing the test case and quitting the driver.

In order to compile and execute these test cases on the LambdaTest platform, I'm going to use the Maven install command. This command can also be found in the documentation that I referenced earlier. In this command, we perform a Maven clean install, and then we specify the test suite XML file, which is the android.xml file. Once I execute this command, I'm going to navigate back to LambdaTest in my browser.

As you can see, both tests run in parallel on their target devices, and remember that these tests are running on physical devices. As you can see, our test cases have run successfully on a Galaxy S21 and a Galaxy S21 Ultra 5G. For each test execution, there is a screen recording of the device. In addition to a screen recording, screenshots are provided for each action that is taken during test execution.

We can view information about the application as well as a tunnel ID if a Lambda Tunnel was running, which in this case it wasn't. We can also view the set capabilities for this particular test session. If you'd like, you can share this recording and test details via email or a shareable link. We're also provided a graphical view of the test logs, which can be searched. For each log entry, we can view the parameters as well as the response for a particular action. If I select Visual, it will also display the screenshot associated with this action.

Under the Network tab, we can view network logs if network logs are enabled. Under the Device tab, we can copy this curl command to download the device logs to our local machine, or we can view raw device logs in our browser. Under the Appium tab, we can copy this curl command to download Appium logs to our local machine. Similar to device logs, we can also view raw Appium logs in our browser. I hope you enjoyed this demonstration of app automation testing on real devices hosted on the LambdaTest platform. Thanks for watching, and I will see you in the next video.

More Videos from Real Device Testing