Get more updates and further details about your project right in your mailbox.
The best time to establish protocols with your clients is when you onboard them.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.
Appium is an open-source tool you can utilize to automate mobile web, mobile native, and mobile hybrid applications on iOS and Android outlets. Appium is “cross-platform” in that it enables you to create tests using the same API for a variety of platforms, including iOS, Android, and others. This enables significant or complete code reuse between iOS and Android test suites.
We will cover the Windows-Android setup in this article.
Appium server can be installed using two ways.
If you using 1.21.0 or before, the below Appium Inspector installation does not apply. You can directly open the inspector from the Appium server page by clicking the search button.
Python Installation
Java Installation
5. Add the base paths of the build tools, tools, and platform tools to the environment variable like below.
Install plugins like Selenium and Appium Python Client
Open cmd and run the below commands
pip install selenium
Install Selenium using this command.
pip install Appium-Python-Client==2.0.0
Install Appium Python Client using this command.
Now, all the setups are done, It’s time to begin developing the mobile application’s automation script.
I am using a virtual environment for my project.
Command to create a venv ‘python -m venv /path/to/folder’
I created a folder tests in my venv to write the automation scripts.
Before we start writing the test script we need to locate the elements of the application to write the test scripts.
Run the Appium and Appium Inspector to create the local session.
Add the Desired Capabilities as per your requirements (device name and application path) and start the session. It will start the application and shows the application page in the inspector, where you can get the locators such as id, Xpath, text, class, etc. Here I have used the Flipkart application to test.
In the above screenshot we can see the first page of the Flipkart application. In that we can get the locators of the elements which we need to locate. Using these locators we start writing the sample test case to run.
Here we add some desired capabilities in a file ‘des_cap.py’. This is the capability file to run the automation.
Create a test file hello.py to start the basic automation.
Here I have imported the needed packages and capability file(des_cap) and then initialized the driver. In the automation script, I tried to choose the language using the name of the element, then clicked the ‘continue’ button using the ID, then input the mobile number using the id and send_keys method and then used Xpath to click the ‘next’ button. Here I have used the most important locators to write the script.
This is a sample test run to show how the automation works. You can check the Appium documentation to know more information. Please comment below if you have any queries.