What is Appium?
8th January 2024|Yogesh Loganathan
Appium is an open-source automation tool. It can be used to automate test cases in mobile, web, native and hybrid applications on Android/IOS mobile and Windows desktop platforms. It supports multiple programming languages like Java, Python, PHP etc.
The Difference between Native, Web and Hybrid apps:
Native apps are the apps that are written using Android, IOS or Windows SDKs. These applications can be used only after installation on the device.
Web apps can be accessed using browsers of the device we are using. Mobile web apps and desktop web apps can be accessed using mobile and desktop browsers, respectively.
As the name says, hybrid apps are the combination of both native and web apps. These apps work in the same manner as web apps, but are downloaded to the device like native apps.
Why Appium?
Appium is open source and a cost-effective solution for automating mobile app testing. It is cross-platform compatible and can be used to test apps on both Android and iOS devices. It gives flexibility to use the testing framework of their choice as it can be easily embedded with different frameworks.
How to start?
1.Download Java and set JAVA_HOME in environment variables.
2.Download Android studio for Emulators.
3. Get the Android installation path in Local and set SDK location in ANDROID_HOME Environment variable.
4.Create and configure Emulator in Android studio.
5.Open Emulator in local.
How to open VD/Emulator using Android studio “Virtual Device Manager”:
How to open VD/Emulator using command prompt:
6. Download node.js.
7.Set NODE_HOME in Environment variables.
8. Set npm in Environment variables.
9. Download Appium Server from node.
10. Install any IDE (Eclipse/IntelliJ) and create project and configure Appium libraries.
11. Create a Maven project and add dependencies of Appium-Java-client and Selenium Java and TestNg in pom.xml and build the project
12. Start Appium Server
a. From Command prompt (Use command “appium”):
b. From Appium Application:
Open Appium app > Click on start S
13. Create a base class and add the required Desired Capabilities and valid URL (Appium server URL).
Desired Capabilities:
Parameters for the above
Note: APPLICATION_PATH in Desired Capabilities is the path where the .exe file of the test application exists.
14. Initiate AppiumDriver (Android/Ios) and pass URL and desired capabilities object as parameters.
15. Make sure that Appium server and emulator are up and running.
16. Annotate properly (using Test Ng) and run a simple test to check whether configurations are done properly.
HOW TO START APPIUM SERVER USING CODE:
withIPAddress (IP_Address)
usingDriverExecutable (new File(path)
withArgument (BASEPATH, "/wd/hub")
OPTIONAL:
withArgument (GeneralServerFlag.SESSION_OVERRIDE)
withArgument (GeneralServerFlag.LOG_LEVEL, "debug")
NOTE: BASEPATH, GeneralServerFlag.SESSION_OVERRIDE and GeneralServerFlag.LOG_LEVEL are from GeneralServerFlag enum which implements “ServerArgument” interface.
3.Create an object for “AppiumDriverLocalService” class and call buildService method by passing“AppiumServiceBuilder” object.
AppiumDriverLocalService service = AppiumDriverLocalService.buildService(builder)
4. Call start() using the “AppiumDriverLocalService” object.
service.start()
Parameters for the above:
HOW TO STOP APPIUM SERVER USING CODE:
Call stop() using the “AppiumDriverLocalService” object created while starting the server.
service.stop()
Conclusion:
Since we have many platforms for testing, Appium is the one which is more flexible, cost-efficient and has good community support. Though it has some disadvantages, it is good to choose automation tools based on the requirement and the nature of the application which is under test.
If this is of interest and you would like to explore further then please contact info@anyaconsultancy.com
For more information on ACS, technology and domain expertise, please visit our website at www.anyaconsultancy.com
About Anya Consultancy Services
ACS is a global SI headquartered in the UK with offices On-shore in England and Scotland, Near-shore in Romania and Portugal and Off-shore in India.
We started in 2010 as an integration specialist, working with big enterprises to integrate ERP, Manufacturing, Warehouse and e-Commerce solutions.
Since that time, we have widened our portfolio via a mix of organic growth and acquisitions to encompass a Hi-tech engineering capability, our successful IT services business and a growing portfolio of SaaS solutions from in store radio station management through to Digital catering solutions feeding ‘000s of NHS patients every day.