
Explore Python-based mobile automation with Appium from scratch, with projects, covering setup, Android and iOS automation, and a robust pytest framework for test execution and reporting.
Install Python on Windows by downloading the official exe, running the installer, and updating the path; verify with Python --version and rely on pip included with Python 3.x.
Explore the Appium plus Python mobile automation course materials, including Android and iOS code, logs, factory and object models, and the APM framework with downloadable source code and documentation.
Explore what editors and IDEs are, compare Notepad to Word, and learn how to install and launch PyCharm on Windows and Mac for Python automation projects.
Explore variables and data types in Python, including integers, floats, and strings, with practical examples, type checking, and usage of GitHub Copilot for code suggestions.
Install GitHub Copilot as a PyCharm plugin, log in and authorize, restart the IDE, and access Copilot in the editor footer to get AI code suggestions.
Learn the fundamentals of operators in Python, including arithmetic, assignment, comparison, and logical operators, with practical examples of addition, subtraction, multiplication, division, and modulo.
Learn how Python performs implicit type conversion and explicit type casting with int, float, and str, illustrated by converting strings to numbers and mixing int with float.
Learn how Python lists store multiple items of different data types, maintain order, and support duplicates. Practice list operations—print, index-based updates, append, insert, remove, and length with employee data examples.
Learn a Python dictionary, a key‑value collection in curly braces, using an employee example to access with get, delete with del, and count with length, noting keys and values immutable.
Explore practical Python dictionaries from scratch: define, add, delete, and update key–value pairs, use get, items, keys, values, pop and clear, and observe insertion order.
This lecture covers static methods in Python, defined with the @staticmethod decorator and bound to the class, callable via the class name or an instance.
Explore how Python constructors work, focusing on the __init__ method that initializes variables when an object is created. See student details examples using self to set name and age.
You can download HOMEBREW from brew official website
Set up Appium Python workflow by installing Node.js, Android Studio, and PyCharm, plus Mac-specific Xcode; verify installations and configure environment variables across Windows and Mac.
Learn Appium uses drivers like UI Automator two and UI test driver to automate Android and iOS, and how capabilities shift to UI Automator two options and UI test options.
Learn to verify compatibility between Appium Python client and Selenium, understand how version alignment prevents class not found errors, and use the official compatibility matrix on GitHub.
Automate signup and login flows in a mobile app using Appium and Python, including handling text fields, alerts, and XPath-based element interactions for reliable automation.
Demonstrates a practical Appium and Python workflow to locate a native app sign-up button, extract x, y, width, height, and compute center coordinates.
Perform a vertical scroll down in appium python using an action chain, pointer input, and interactions, calculating start and end coordinates from screen height and converting to W3 actions.
import time
from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.options.ios import XCUITestOptions
from appium.webdriver.appium_service import AppiumService
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.actions.pointer_input import PointerInput
from selenium.webdriver.common.actions import interaction
from selenium.webdriver.common.actions.action_builder import ActionBuilder
desired_caps = dict(
deviceName = 'Android',
platformName = 'Android',
automationName = 'UiAutomator2',
platformVersion = '13',
app = '/Users/lucky/Downloads/app/Android/ApiDemos.apk'
# appActivity = 'com.swaglabsmobileapp.MainActivity'
)
capabilities_options = UiAutomator2Options().load_capabilities(desired_caps)
driver = webdriver.Remote('http://127.0.0.1:4723',options=capabilities_options)
time.sleep(5)
driver.implicitly_wait(40)
driver.find_element(AppiumBy.ACCESSIBILITY_ID,'Views').click()
time.sleep(2)
ui_scrollable =('new UiScrollable(new UiSelector().scrollable(true))'
'.scrollIntoView(new UiSelector().text("WebView"))')
driver.find_element(AppiumBy.ANDROID_UIAUTOMATOR,ui_scrollable)
driver.find_element(AppiumBy.ACCESSIBILITY_ID,'WebView').click()
time.sleep(1)
driver.quit()
import time
from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.options.ios import XCUITestOptions
from appium.webdriver.appium_service import AppiumService
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.actions.pointer_input import PointerInput
from selenium.webdriver.common.actions import interaction
from selenium.webdriver.common.actions.action_builder import ActionBuilder
desired_caps = dict(
deviceName = 'Android',
platformName = 'Android',
automationName = 'UiAutomator2',
platformVersion = '13',
app = '/Users/lucky/Downloads/app/Android/ApiDemos.apk'
# appActivity = 'com.swaglabsmobileapp.MainActivity'
)
capabilities_options = UiAutomator2Options().load_capabilities(desired_caps)
driver = webdriver.Remote('http://127.0.0.1:4723',options=capabilities_options)
time.sleep(5)
driver.implicitly_wait(40)
driver.find_element(AppiumBy.ACCESSIBILITY_ID,'Views').click()
time.sleep(2)
ui_scrollable =('new UiScrollable(new UiSelector().scrollable(true))'
'.setAsVerticalList()'
'.scrollIntoView(new UiSelector().text("Lists"))')
driver.find_element(AppiumBy.ANDROID_UIAUTOMATOR,ui_scrollable)
driver.find_element(AppiumBy.ACCESSIBILITY_ID,'Lists').click()
driver.find_element(AppiumBy.ACCESSIBILITY_ID,'01. Array').click()
ui_scrollable1 =('new UiScrollable(new UiSelector().scrollable(true))'
'.scrollIntoView(new UiSelector().text("Curd"))')
driver.find_element(AppiumBy.ANDROID_UIAUTOMATOR,ui_scrollable1)
time.sleep(1)
driver.quit()
import time
from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.options.ios import XCUITestOptions
from appium.webdriver.appium_service import AppiumService
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.actions.pointer_input import PointerInput
from selenium.webdriver.common.actions import interaction
from selenium.webdriver.common.actions.action_builder import ActionBuilder
desired_caps = dict(
deviceName = 'Android',
platformName = 'Android',
automationName = 'UiAutomator2',
platformVersion = '13',
app = '/Users/lucky/Downloads/app/Android/ApiDemos.apk'
# appActivity = 'com.swaglabsmobileapp.MainActivity'
)
capabilities_options = UiAutomator2Options().load_capabilities(desired_caps)
driver = webdriver.Remote('http://127.0.0.1:4723',options=capabilities_options)
time.sleep(5)
driver.implicitly_wait(40)
driver.find_element(AppiumBy.ACCESSIBILITY_ID,'Views').click()
time.sleep(2)
ui_scrollable =('new UiScrollable(new UiSelector().scrollable(true))'
'.setAsVerticalList()'
'.scrollIntoView(new UiSelector().text("Tabs"))')
driver.find_element(AppiumBy.ANDROID_UIAUTOMATOR,ui_scrollable)
driver.find_element(AppiumBy.ACCESSIBILITY_ID,'Tabs').click()
driver.find_element(AppiumBy.ACCESSIBILITY_ID,'5. Scrollable').click()
ui_scrollable1 =('new UiScrollable(new UiSelector().scrollable(true))'
'.setAsHorizontalList()'
'.scrollIntoView(new UiSelector().text("TAB 14"))')
driver.find_element(AppiumBy.ANDROID_UIAUTOMATOR,ui_scrollable1)
time.sleep(1)
driver.quit()
import time
from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.options.ios import XCUITestOptions
from appium.webdriver.appium_service import AppiumService
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.actions.pointer_input import PointerInput
from selenium.webdriver.common.actions import interaction
from selenium.webdriver.common.actions.action_builder import ActionBuilder
desired_caps = dict(
deviceName = 'Android',
platformName = 'Android',
automationName = 'UiAutomator2',
platformVersion = '13',
app = '/Users/lucky/Downloads/app/Android/ApiDemos.apk'
# appActivity = 'com.swaglabsmobileapp.MainActivity'
)
capabilities_options = UiAutomator2Options().load_capabilities(desired_caps)
driver = webdriver.Remote('http://127.0.0.1:4723',options=capabilities_options)
time.sleep(5)
driver.implicitly_wait(40)
driver.find_element(AppiumBy.ACCESSIBILITY_ID,'Views').click()
time.sleep(2)
ui_scrollable =('new UiScrollable(new UiSelector().scrollable(true))'
'.setAsVerticalList()'
'.scrollIntoView(new UiSelector().text("Lists"))')
driver.find_element(AppiumBy.ANDROID_UIAUTOMATOR,ui_scrollable)
driver.find_element(AppiumBy.ACCESSIBILITY_ID,'Lists').click()
driver.find_element(AppiumBy.ACCESSIBILITY_ID,'01. Array').click()
ui_scrollable1 =('new UiScrollable(new UiSelector().scrollable(true))'
'.setMaxSearchSwipes(2)'
'.scrollIntoView(new UiSelector().text("Curd"))')
driver.find_element(AppiumBy.ANDROID_UIAUTOMATOR,ui_scrollable1)
time.sleep(1)
driver.quit()
import time
from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.options.ios import XCUITestOptions
from appium.webdriver.appium_service import AppiumService
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.actions.pointer_input import PointerInput
from selenium.webdriver.common.actions import interaction
from selenium.webdriver.common.actions.action_builder import ActionBuilder
desired_caps = dict(
deviceName = 'Android',
platformName = 'Android',
automationName = 'UiAutomator2',
platformVersion = '13',
app = '/Users/lucky/Downloads/app/Android/ApiDemos.apk'
# appActivity = 'com.swaglabsmobileapp.MainActivity'
)
capabilities_options = UiAutomator2Options().load_capabilities(desired_caps)
driver = webdriver.Remote('http://127.0.0.1:4723',options=capabilities_options)
time.sleep(5)
driver.implicitly_wait(40)
driver.find_element(AppiumBy.ACCESSIBILITY_ID,'Views').click()
time.sleep(2)
ui_scrollable =('new UiScrollable(new UiSelector().scrollable(true))'
'.scrollForward()')
driver.find_element(AppiumBy.ANDROID_UIAUTOMATOR,ui_scrollable)
time.sleep(2)
ui_scrollable1 =('new UiScrollable(new UiSelector().scrollable(true))'
'.scrollBackward()')
driver.find_element(AppiumBy.ANDROID_UIAUTOMATOR,ui_scrollable1)
time.sleep(1)
driver.quit()
import time
from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.options.ios import XCUITestOptions
from appium.webdriver.appium_service import AppiumService
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.actions.pointer_input import PointerInput
from selenium.webdriver.common.actions import interaction
from selenium.webdriver.common.actions.action_builder import ActionBuilder
desired_caps = dict(
deviceName = 'Android',
platformName = 'Android',
automationName = 'UiAutomator2',
platformVersion = '13',
app = '/Users/lucky/Downloads/app/Android/ApiDemos.apk'
# appActivity = 'com.swaglabsmobileapp.MainActivity'
)
capabilities_options = UiAutomator2Options().load_capabilities(desired_caps)
driver = webdriver.Remote('http://127.0.0.1:4723',options=capabilities_options)
time.sleep(5)
driver.implicitly_wait(40)
driver.find_element(AppiumBy.ACCESSIBILITY_ID,'Views').click()
time.sleep(2)
ui_scrollable =('new UiScrollable(new UiSelector().scrollable(true))'
'.setAsVerticalList()'
'.scrollIntoView(new UiSelector().text("Lists"))')
driver.find_element(AppiumBy.ANDROID_UIAUTOMATOR,ui_scrollable)
driver.find_element(AppiumBy.ACCESSIBILITY_ID,'Lists').click()
driver.find_element(AppiumBy.ACCESSIBILITY_ID,'01. Array').click()
ui_scrollable1 =('new UiScrollable(new UiSelector().scrollable(true))'
'.scrollToEnd(5)')
driver.find_element(AppiumBy.ANDROID_UIAUTOMATOR,ui_scrollable1)
time.sleep(2)
ui_scrollable2 =('new UiScrollable(new UiSelector().scrollable(true))'
'.scrollToBeginning(3)')
driver.find_element(AppiumBy.ANDROID_UIAUTOMATOR,ui_scrollable2)
time.sleep(1)
driver.quit()
Learn to start and stop the Appium server programmatically using an Appium service, verify is running and listening, and manage sessions within your Python automation workflow.
Record app interactions with the Appium inspector, identify elements, capture coordinates, and generate reusable code for taps and text input.
Explore mac configuration for iOS automation by installing homebrew, node.js, apm tools, and Xcode, then build ui kit catalog app and run it in a simulator using dot app file.
Learn to handle various mobile alerts in Appium with Python, including simple, cancel, text entry, confirm, and destructive alerts, using accessibility IDs and robust tapping strategies.
Demonstrates handling a date picker in Appium with Python, using accessibility IDs and XPath for dynamic elements, and selecting date and time from the calendar while discussing dynamic date logic.
Learn to generate tomorrow's date dynamically for a date picker in Python-based Appium automation, using datetime, timedelta, and strftime to produce a formatted day and date label.
Switch from native to web view in iOS using Appium with Python, locate sign-up elements by accessibility ID or XPath, and handle the Google sign-up flow inside the web view.
PyTest: Unit testing framework for Python , helps you to create test case and overall execution report
Project Settings ==> Python Interpreter under ur project
click + ==> enter Pytest ==> install it
Always your test case should start with “test”
Import pytest
Even function name should start with “test”
Directly run individual tests & even run allYou can do configuration for pyest execution
You can run ur pytests from terminal itself by going to the folder and use pytest.
If there are multiple files then specify file name along with pytest
If you want to see details then pytest filename -s , you can also add -v after -s
Install the html and allure report plugins for pytest, then generate html and allure reports from the terminal, producing a reports.html file for the html output.
Learn to run Appium Python mobile automation tests in parallel on simulators using parameterized fixtures with pytest-xdist, and avoid APM port conflicts by using separate ports for each device.
Implement a reusable Python logging utility by creating a utils and logs directory, configuring a log file, and exposing a log() function that returns a configured logger for framework use.
Learn to read data from a config.ini file using Python's configparser, retrieving url, browser name, and execution os from basic info and mobile sections.
Read udid from config.ini using a config reader to set the device in Appium test setup, establishing a session with the device for automated mobile testing.
Generate and validate html reports for mobile automation with pytest and allure, configure json reports, and troubleshoot issues such as no such element exceptions and missing locators.
Learn how to commit and push code to a GitHub repository from PyCharm, select files for commit, manage commits, and clone repositories.
Learn to trigger a customized Appium Python framework from Jenkins, configure Jenkins on mac and windows, install plugins, set Python paths, and define build steps to run mobile automation tests.
Install and use the APM images plugin to enable image-based testing in Appium, learn installation steps, server startup, and how image-based element identification works.
import time
import base64
from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.options.ios import XCUITestOptions
from appium.webdriver.appium_service import AppiumService
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.common.by import By
def load_image_base64(path: str):
with open(path, "rb") as f:
return base64.b64encode(f.read()).decode("ascii")
def compare_image(driver):
try:
reference1 = load_image_base64(image_file_path1)
reference2 = load_image_base64(image_file_path2)
driver.find_image_occurrence(base64_partial_image=reference1, base64_full_image=reference2)
print("compare success")
except Exception as e:
print("compare failed")
desired_caps = dict(
deviceName = 'Android',
platformName = 'Android',
automationName = 'UiAutomator2',
platformVersion = '13',
app = '/Users/lucky/Downloads/AutomationTesting/src/test/resources/appfiles/Android.SauceLabs.Mobile.Sample.app.2.7.1.apk',
appActivity = 'com.swaglabsmobileapp.MainActivity'
)
capabilities_options = UiAutomator2Options().load_capabilities(desired_caps)
driver = webdriver.Remote('http://127.0.0.1:4723',options=capabilities_options)
time.sleep(3)
image_file_path1 = '/Users/lucky/Desktop/image3.png'
image_file_path2 = '/Users/lucky/Desktop/image4.png'
compare_image(driver)
time.sleep(3)
driver.quit()
Appium-device-farm : plugin:
Designed to manage and streamline the creation of driver sessions for android & iOS on real devices & emulators and making it idea for CI/CD pipeline
Usage:
Remotely manage sessions for devices
Monitor & manage test sessions
Enhanced session Management
Automated device recognition
Advanced reporting
Parallel test execution
Installation from Appium-installer
How to start Appium-server:
appium --keep-alive-timeout 800 --use-plugins=device-farm --base-path /wd/hub —plugin-device-farm-platform=android
appium server -ka 800 --use-plugins=device-farm -pa /wd/hub --plugin-device-farm-platform=android
http://appiumserverurl/device-farm
Enable server logs :
appium -ka 800 --use-plugins=device-farm -pa /wd/hub --plugin-device-farm-platform=iOS --log ./df1.log
Reset:
appium plugin run device-farm reset
Android Code:
import time
from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.options.ios import XCUITestOptions
from appium.webdriver.appium_service import AppiumService
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.common.by import By
desired_caps = dict(
deviceName = 'Android',
platformName = 'Android',
automationName = 'UiAutomator2',
platformVersion = '13',
app = 'file-1753690680109.apk',
appActivity = 'com.wdiodemoapp.MainActivity'
)
capabilities_options = UiAutomator2Options().load_capabilities(desired_caps)
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',options=capabilities_options)
time.sleep(3)
driver.find_element(By.XPATH,'//android.widget.Button[@content-desc="Forms"]/android.widget.TextView').click()
time.sleep(2)
driver.find_element(By.XPATH,'//android.widget.EditText[@content-desc="text-input"]').send_keys("12345")
time.sleep(3)
driver.quit()
# appium_service.stop()
iOS code:
import datetime
import time
from appium import webdriver
from appium.options.ios import XCUITestOptions
from appium.webdriver.appium_service import AppiumService
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.common.by import By
desired_caps = dict(
deviceName = 'iPhone',
platformName = 'iOS',
automationName = 'XCUITest',
platformVersion = '18.1',
# app = '/Users/lucky/Downloads/app/iOS/Verve.app',
app = '/Users/lucky/Library/Developer/Xcode/DerivedData/UIKitCatalog-cummyqhwpursfvfqelhxxzpuioie/Build/Products/Debug-iphonesimulator/UIKitCatalog.app',
udid = '2E3F1132-0B7C-41BD-A09A-8311B22EF112'
)
# appium_service = AppiumService()
# appium_service.start()
capabilities_options = XCUITestOptions().load_capabilities(desired_caps)
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',options=capabilities_options)
time.sleep(3)
driver.implicitly_wait(45)
# date picker
driver.find_element(AppiumBy.ACCESSIBILITY_ID,"Date Picker").click()
time.sleep(1)
driver.find_element(AppiumBy.XPATH,"(//*[@type='XCUIElementTypeButton'])[3]").click()
days = ["Monday", "Tuesday","Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
tomorrow = datetime.datetime.now() + datetime.timedelta(days=1)
print(tomorrow.date())
# print()
driver.find_element(AppiumBy.ACCESSIBILITY_ID,tomorrow.strftime("%A" + " %d" + " %B")).click()
time.sleep(1)
driver.find_element(AppiumBy.XPATH,"//XCUIElementTypeButton[@name='UIKitCatalog']").click()
time.sleep(3)
driver.quit()
# appium_service.stop()
npm install -g appim-doctor
Installation on MAC:
brew install ffmpeg
ffmpeg -version
windows:
https://www.ffmpeg.org/download.html
Select Windows
Select Windows builds from gyan.dev
Download ffmpeg-git-full.7z under latest git master branch build
Unzip it , place it in C drive n rename it
Launch CMD prompt as admin
setx /m PATH “/Users/lucky/Downloads/ffmpeg/bin;%PATH%”
ffmpeg -version
Android Code :
import time
from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.options.ios import XCUITestOptions
from appium.webdriver.appium_service import AppiumService
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.common.by import By
desired_caps = dict(
deviceName = 'Android',
platformName = 'Android',
automationName = 'UiAutomator2',
platformVersion = '13',
app = '/Users/lucky/Downloads/app/Android/Android-NativeDemoApp-0.4.0.apk',
appActivity = 'com.wdiodemoapp.MainActivity',
)
capabilities_options = UiAutomator2Options().load_capabilities(desired_caps)
capabilities_options.set_capability("df:recordVideo",True)
capabilities_options.set_capability("df:build","Android Smoke 3 - 13.0")
# capabilities_options.set_capability("df:liveVideo",True)
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',options=capabilities_options)
time.sleep(3)
driver.find_element(By.XPATH,'//android.widget.Button[@content-desc="Forms"]/android.widget.TextView').click()
time.sleep(2)
driver.find_element(By.XPATH,'//android.widget.EditText[@content-desc="text-input"]').send_keys("12345")
time.sleep(3)
driver.quit()
# appium_service.stop()
iOS Code:
import datetime
import time
from appium import webdriver
from appium.options.ios import XCUITestOptions
from appium.webdriver.appium_service import AppiumService
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.common.by import By
desired_caps = dict(
deviceName = 'iPhone',
platformName = 'iOS',
automationName = 'XCUITest',
platformVersion = '18.1',
# app = '/Users/lucky/Downloads/app/iOS/Verve.app',
app = '/Users/lucky/Library/Developer/Xcode/DerivedData/UIKitCatalog-cummyqhwpursfvfqelhxxzpuioie/Build/Products/Debug-iphonesimulator/UIKitCatalog.app',
udid = '2E3F1132-0B7C-41BD-A09A-8311B22EF112'
)
# appium_service = AppiumService()
# appium_service.start()
capabilities_options = XCUITestOptions().load_capabilities(desired_caps)
capabilities_options.set_capability("df:recordVideo",True)
capabilities_options.set_capability("df:build","iOS Smoke 4 - 18.1")
# capabilities_options.set_capability("df:liveVideo",True)
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',options=capabilities_options)
time.sleep(3)
driver.implicitly_wait(45)
# date picker
driver.find_element(AppiumBy.ACCESSIBILITY_ID,"Date Picker").click()
time.sleep(1)
driver.find_element(AppiumBy.XPATH,"(//*[@type='XCUIElementTypeButton'])[3]").click()
days = ["Monday", "Tuesday","Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
tomorrow = datetime.datetime.now() + datetime.timedelta(days=1)
print(tomorrow.date())
# print()
driver.find_element(AppiumBy.ACCESSIBILITY_ID,tomorrow.strftime("%A" + " %d" + " %B")).click()
time.sleep(1)
driver.find_element(AppiumBy.XPATH,"//XCUIElementTypeButton[@name='UIKitCatalog']").click()
time.sleep(3)
driver.quit()
# appium_service.stop()
Android Code :
import time
from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.options.ios import XCUITestOptions
from appium.webdriver.appium_service import AppiumService
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.common.by import By
desired_caps = dict(
deviceName = 'Android',
platformName = 'Android',
automationName = 'UiAutomator2',
platformVersion = '13',
app = '/Users/lucky/Downloads/app/Android/Android-NativeDemoApp-0.4.0.apk',
appActivity = 'com.wdiodemoapp.MainActivity',
)
capabilities_options = UiAutomator2Options().load_capabilities(desired_caps)
capabilities_options.set_capability("df:recordVideo",True)
capabilities_options.set_capability("df:build","Android Smoke 3 - 13.0")
# capabilities_options.set_capability("df:liveVideo",True)
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',options=capabilities_options)
time.sleep(3)
driver.find_element(By.XPATH,'//android.widget.Button[@content-desc="Forms"]/android.widget.TextView').click()
time.sleep(2)
driver.find_element(By.XPATH,'//android.widget.EditText[@content-desc="text-input"]').send_keys("12345")
time.sleep(3)
driver.quit()
# appium_service.stop()
iOS Code:
import datetime
import time
from appium import webdriver
from appium.options.ios import XCUITestOptions
from appium.webdriver.appium_service import AppiumService
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.common.by import By
desired_caps = dict(
deviceName = 'iPhone',
platformName = 'iOS',
automationName = 'XCUITest',
platformVersion = '18.1',
# app = '/Users/lucky/Downloads/app/iOS/Verve.app',
app = '/Users/lucky/Library/Developer/Xcode/DerivedData/UIKitCatalog-cummyqhwpursfvfqelhxxzpuioie/Build/Products/Debug-iphonesimulator/UIKitCatalog.app',
udid = '2E3F1132-0B7C-41BD-A09A-8311B22EF112'
)
# appium_service = AppiumService()
# appium_service.start()
capabilities_options = XCUITestOptions().load_capabilities(desired_caps)
capabilities_options.set_capability("df:recordVideo",True)
capabilities_options.set_capability("df:build","iOS Smoke 4 - 18.1")
# capabilities_options.set_capability("df:liveVideo",True)
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',options=capabilities_options)
time.sleep(3)
driver.implicitly_wait(45)
# date picker
driver.find_element(AppiumBy.ACCESSIBILITY_ID,"Date Picker").click()
time.sleep(1)
driver.find_element(AppiumBy.XPATH,"(//*[@type='XCUIElementTypeButton'])[3]").click()
days = ["Monday", "Tuesday","Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
tomorrow = datetime.datetime.now() + datetime.timedelta(days=1)
print(tomorrow.date())
# print()
driver.find_element(AppiumBy.ACCESSIBILITY_ID,tomorrow.strftime("%A" + " %d" + " %B")).click()
time.sleep(1)
driver.find_element(AppiumBy.XPATH,"//XCUIElementTypeButton[@name='UIKitCatalog']").click()
time.sleep(3)
driver.quit()
# appium_service.stop()
ElementID: this is mandatory whenever u r using mobile gesture commands
Swipe
Scroll
Longpress
drag
What is elementID: its a random hexadecimal code representing the element in the session which is returned by findByElement API
How can I find elementID??
Appium inspector
Can we use id from inspector in program directly???
17000000-0000-0000-1B10-000000000000
17000000-0000-0000-3016-000000000000
17000000-0000-0000-1817-000000000000
import time
from appium import webdriver
from appium.options.android import UiAutomator2Options
from appium.options.ios import XCUITestOptions
from appium.webdriver.appium_service import AppiumService
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.common.by import By
desired_caps = dict(
deviceName = 'Android',
platformName = 'Android',
automationName = 'UiAutomator2',
platformVersion = '13',
app = '/Users/lucky/Downloads/app/Android/Android-NativeDemoApp-0.4.0.apk',
appActivity = 'com.wdiodemoapp.MainActivity'
)
capabilities_options = UiAutomator2Options().load_capabilities(desired_caps)
driver = webdriver.Remote('http://127.0.0.1:4723',options=capabilities_options)
time.sleep(3)
obj = driver.find_element(By.XPATH,'//android.widget.Button[@content-desc="Login"]/android.widget.TextView')
print(obj.id)
time.sleep(3)
driver.quit()
# appium_service.stop()
Explore practical swipe gestures using the Appium gestures plugin in Android, performing swipe up, down, left, and right with Python scripts and scroll element into view.
Master swipe left and swipe right gestures in an app using the Appium gestures plugin, including locating elements by accessibility id or XPath and validating the interactions through a run.
Practice drag and drop with Appium gestures plugin in Python by selecting source and destination elements in the API demos application, using accessibility IDs and a basic session setup.
Master double tap gestures on Android and iOS using appium-gestures-plugin in a Python mobile automation workflow, locating elements by accessibility id and element id.
import time
from appium import webdriver
from appium.options.ios import XCUITestOptions
from appium.webdriver.appium_service import AppiumService
from appium.webdriver.common.appiumby import AppiumBy
from selenium.webdriver.common.by import By
desired_caps = dict(
deviceName = 'iPhone',
platformName = 'iOS',
automationName = 'XCUITest',
platformVersion = '18.1',
app = '/Users/lucky/Downloads/app/iOS/Verve.app',
# app = '/Users/lucky/Library/Developer/Xcode/DerivedData/UIKitCatalog-cummyqhwpursfvfqelhxxzpuioie/Build/Products/Debug-iphonesimulator/UIKitCatalog.app',
udid = '2E3F1132-0B7C-41BD-A09A-8311B22EF112'
)
# appium_service = AppiumService()
# appium_service.start()
capabilities_options = XCUITestOptions().load_capabilities(desired_caps)
# capabilities_options.set_capability("Plugins","gestures")
driver = webdriver.Remote('http://127.0.0.1:4723',options=capabilities_options)
time.sleep(10)
# driver.find_element(by=AppiumBy.ACCESSIBILITY_ID, value='Steppers').click()
list_view = driver.find_element(by=AppiumBy.XPATH, value='//XCUIElementTypeButton[@name="Sign up"]')
driver.execute_script('gesture: longPress',
{'elementId': list_view.id,
'duration': 8000,
'pressure':0.5})
time.sleep(9)
driver.quit()
# appium_service.stop()
noReset vs fullReset
Type Boolean
Default value false
fullReset —> True —> uninstall the app nn reinstall the app before each n every session
DATA is cleared
Simulates a fresh app to be installed
Slower execution
noReset —> True App is not reinstall
Faster execution
setUdid vs setDeviceName:
Both are used to specify the device for our automation
deviceName —> name of the device & its a mandatory options we need to pass
If only 1 device is connected I can go with generic name like Android or iOS
uDID : optional for Android , which we can get from adb devices
is the unique device identifier for a device which is a mandatory capability we will pass in iOS that identify the simulator or real device
Course is updated on 11-December-2025 with below concepts:
Overview on AI
Overview on LLM
Overview on RAG
Overview on Generative AI
Overview on Memory
Overview on AI Agent
Overview on LangChain & LangGraph
Overview on MCP Server
Overview on Human In the loop , Hallucination & Guardrails
Overview on Fine-Tuning
Overview on Context
Overview on Prompts
ChatGPT vs CoPilot vs CURSOR
Overview on OpenAI
Overview on AI Models
Overview on n8n workflow
Generate API Key in OpenAI
Create workflow in n8n
Create Public Chat in n8n workflow
Overview on OpenAI Tokens
CURSOR - Create a Chrome Extension for Record & Playback
CURSOR - Create an OTP Shield Mobile APP
Install GITHUB Copilot to PyCharm Editor
Generate Appium Python Program using CoPilot in PyCharm
Generate framework code using CoPilot
Course is updated on 09-08-2025 with below topics
When to use ID & Xpath - doubts clarification video added at lecture 31
Course is updated on 04-08-2025 with below topics
Scroll using UiScrollable
Scroll using UiScrollable - setAsVerticalList
Scroll using UiScrollable - setAsHorizontalList
Scroll using UiScrollable - setMaxSearchSwipes
Scroll using UiScrollable - scrollForward & scrollBackward
Scroll using UiScrollable - ScrollToEnd & scrollToBeginning
Course is updated on 03-08-2025 with below topics
Parallel Execution using systemPort & wdaLocalPort
Course is updated on 02-08-2025 with below topics
Appium-gestures-plugin : DoubleTap
Appium-gestures-plugin : longPress
Course is updated on 01-08-2025 with below topics
Overview on ElementID
Appium-gestures-plugin installation & overview
Appium-gestures-plugin : Swipe Up & Swipe Down- Android
Appium-gestures-plugin : Swipe Up & Swipe Down- iPhone
Appium-gestures-plugin : Swipe Left & Swipe Right
Appium-gestures-plugin : Drag and Drop
Course is updated on 31-07-2025 with below topics
Coordinates identification which covers X , Y, Height & Width
Course is updated on 30-07-2025 with below topics
We added a new section in which we are going to upload Q & A's & Student's requested topics, please find below section name "Interview Question & Answers & Student Requested Topics"
Course is updated on 29-07-2025 with below topics
Appium-device-farm plugin - Video Recording Configuration
Appium-device-farm plugin - Video Recording Implementation
Course is updated on 28-07-2025 with below topics
find_image_occurrence command with example
appium-device-farm plugin configuration , implementation with example
Course is updated on 27-07-2025 with below topics
getImagesSimilarity command with example
Course is updated on 26-07-2025 with below topics
Appium-Dashboard Plugin with examples
Appium-Image Plugin with examples
Course is updated on 08-June-2025:
Customised framework for Mobile & Web - Single framework that supports Mobile Apps & Web application
Appium using Python - Master Mobile automation testing with APPIUM 2.X on Android & iOS devices
This Course is created for complete beginners, Lets get started with Appium using Python step by step
There is a huge demand for Mobile automation testers, If you are a complete beginner on Appium or Python this course helps you to master the tool. Very basic step by step videos to guide you from scratch
We will learn below topics in this course:
Introduction to Python
Install Python on Windows
Install Python on MAC
Overview on editors and install PyCharm
Configure Eclipse editor for python scripting
Creating a project and adding comments to PyCharm
Data types and examples
Examples on String data type
Overview on List with examples
If Statement and examples
For Loop statements with examples
While Loop statements with examples
overview on functions and import
Introduction to Class and Object
Importance of HOMEBREW
APPIUM Python Configuration
Overview on Appium 2.X
Install Appium 2.X , Install Drivers for Android & iOS executions
Overview on Drivers & Options
Appium Python Program to Launch Android & iOS App
Overview on USB Debugging Mode & Connect Real Android Phone
Appium Inspector - Overview , Installation, Example
Scenario : Launch app & Handle Button, Text field
Scenario : Handling Alerts, Text Fields , Buttons- Singup & Login flow
Scenario : Handling Switch, Dropdown & Alert Button
Scenario : Handling DropDown using FindElements, GetAttribute
Scenario : ScrollDown using latest actions
Scenario : TAP & LongPress using latest actions
Overview on Synchronisation with examples
Start APPIUM Server using a Program
Appium Inspector ==> Record & Identify Elements using Coordinates
Examples on Keyboard Handling
Handling Hybrid App ==> Switching Context
Handling SYSTEM Apps - Camera & Calculator
Scenario - WEB APP Handling
Screenshot & Video capturing
noReset with example
OPTIONAL - MAC CONFIGURATION OVERVIEW
Establish Inspector Session for UIKitCatalog app on simulator
Handling Buttons , Text Fields, Checkbox on Simulator
Handling of Switches
Handling Alerts
Handling Date Picker
Handling Picker View
Switch Context - From Native to Web View
Tap using coordinates
Perform Scroll down on the app
Configuring PyTest & Executing Basic functions
PyTest Fixtures & Decorators with examples
PyTest Marker, Parameterised Markers with examples
PyTest Hard Assertions, Soft Assertions
PyTest Launch App on iPhone Simulator
Pytest Parameters in Launching iOS App
PyTest Reports - HTML & ALLURE with examples
PyTest - Capture Screenshot & Screenshot on Failure
Parallel Execution on Simulators
Generate Logs
Reading Data from a Config File
Read Data From Excel & Write Data in Excel
Framework - Page Factory Model
Overview on GITHUB
Appium Framework Part - Jenkins Integration
Lets Get Started... Wish you Good luck