top of page
hand-businesswoman-touching-hand-artificial-intelligence-meaning-technology-connection-go-

Appium Mobile App Automation

Appium is an open-source test automation framework for use with native, hybrid, and mobile web apps.

It drives iOS, Android, and Windows apps using the WebDriver protocol.




Appium architecture




Features of Appium


  • Appium does not require application source code or library.

  • Appium provides a strong and active community.

  • Appium has multi-platform support i.e., it can run the same test cases on multiple platforms.

  • Appium allows the parallel execution of test scripts.

  • In Appium, a small change does not require re-installation of the application.

  • Appium supports various languages like C#, Python, Java, Ruby, PHP, JavaScript with node.js, and many others that have Selenium client library.


Advantages of Appium


  • Appium is an open-source tool, which means it is freely available. It is easy to install.

  • It allows the automated testing of hybrid, native, and web applications.

  • Unlike other testing tools, you do not need to include any additional agents in your app to make Appium compatible with automation. It tests the same app, which is going to upload in App Store.

  • An additional feature added to Appium. Now it would support desktop application testing for windows as well along with mobile application testing.

  • Appium is a cross-platform, freely available mobile testing tool, which allows us the cross-platform mobile testing. This means you can test on multiple platforms (single API for both Android and IOS platforms).


Disadvantages of Appium


  • Lack of detailed reports.

  • Since the tests depend on the remote web driver, so it is a bit slow.

  • It is not a limitation, but an overhead that Appium uses UIAutomator for Android that only supports Android SDK, API 16, or higher. However, Appium supports older APIs, but not directly. It uses another open-source library Selendroid to support older APIs.

  • In iOS, only one instance (iOS Script) can run on one Mac OS device, which means one test can be executed at a time per Mac. If you want to run your tests on multiple iOS devices at the same time, you need to arrange the same number of Mac machines. But it would be expensive to arrange various Mac machines.

Types of Mobile Applications


Native Applications


Native applications are software programs that are developed by keeping a certain platform in mind. These applications are developed using a specific software development kit. Native apps are developed for use on a specific device and can be installed from the App Store, such as Google Play Store or Apple's App Store. They can work offline and can also use the device notification system.

Some native application examples are - Pinterest, Skype, Snapchat, etc.


Web Applications


Web applications are not real applications, they are websites that run on browsers. These applications are developed using HTML, CSS, and JavaScript at a very low price. Unlike Android and iOS apps, they do not require a Software Development Kit (SDK) for developers to work with. Web applications are not developed for a particular platform. Since the web applications run on web browsers, they don't require any installation.

Some web application examples are - Flipkart, Ali Express, twitter, etc.


Hybrid Applications


Hybrid application is a combination of native and web applications. Like native applications, these applications can be downloaded from the App Store and also can take advantage of device features, but actually they are web applications inside. They are developed using web development languages - HTML, CSS, and JavaScript like the hybrid app, which allows them to run on any platform.

Some hybrid application examples are - OLA, Instagram, Basecamp, etc.


Pre-requisites


  1. Download the Java JDK (Java Development Kit) installation package. https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html

  2. Install the Java JDK on your system.

  3. Set up the “JAVA_HOME” environment variable to point to the installation directory of the Java JDK.

  4. Update the system’s “PATH” variable to include the “%JAVA_HOME%\bin” directory.

  5. Download the Maven installation package from the official website. https://maven.apache.org/download.cgi

  6. Unzip the Maven package to the desired folder.

  7. Configure Maven by setting up the “MAVEN_HOME” environment variable to point to the installation directory.

  8. Update the system’s “PATH” variable to include the “%MAVEN_HOME%\bin” directory.

  9. Download and Install IntelliJ IDEA Community Edition. https://www.jetbrains.com/idea/download

  10. Download and Install XCode. https://apps.apple.com/us/app/xcode/id497799835?mt=12

  11. Download Android SDK. (If you need the emulators in Android Studio, Download and install Android Studio too) https://developer.android.com/studio

  12. Configure Android by setting up the “ANDROID_HOME” environment variable to point to the Android SDK directory.

  13. Update the system’s “PATH” variable to include the “%ANDROID_HOME%\platform-tools” directory.

  14. Download and Install Node.JS v7.6.0 or above. https://nodejs.org/en/download/

  15. Install Appium 2.0 by executing the below command. npm i -g appium@next

  16. Download and Install Appium Inspector. https://github.com/appium/appium-inspector/releases

  17. You can use Android Studio Emulators or Real devices. But you must enable “Developer options” and “USB debugging” in your device. Also, you should enable “Unknown sources” from Settings → Security.

  18. Install Appium Drivers appium driver install uiautomator2 appium driver install xcuitest

  19. Navigate to the “Environment Variables” settings on your computer and review the variables and their corresponding values listed in the “System Variable” section.

Environment variables

20. Download the sample Android application.https://github.com/appium-boneyard/sample- code/blob/master/sample-code/apps/ApiDemos/bin/ApiDemos-debug.apk


Test an App with Appium


Step 1 − Create a test Project in the Android Studio named as “RobotiumTest”.



Step 2 − Add the Appium jars into your project. Click Project → App → copy all the jars in lib. Select the copied jars except Selenium, Java client and Junit Jar, then right-click on it and click on "Add as Library".


Step 3 − Click on build.gradle in the App. You will see all the libraries added, as shown in the following screenshot.



Step 4 − Now create a Java class as shown below −



Step 5 − Running the Test case.


  • Click on build variant and select Unit Testing.

  • Start the Appium server with the specific port "4444".

  • Download the Appium for Windows from here.

  • Double click on the .exe and install Appium.

  • Click on the icon to up the UI.

  • Change the port if required, as shown below.

  • Click the Play button to start the server.



  • Connect the device with USB debugging on or start an emulator.

  • Right-click the test class and click on "Run".


Reference upon:-


Thanks for Reading.....!!!

44 views0 comments

Recent Posts

See All

Kommentare

Mit 0 von 5 Sternen bewertet.
Noch keine Ratings

Rating hinzufügen
bottom of page