
Explore artificial intelligence: a computer system that learns from data, understands language and images, and can write emails, poems, and automation test cases.
This lecture explains AI agents as software programs that pursue a specific goal by using tools, making independent decisions, and coordinating with other agents through perception, planning, acting, and adaptation.
Explore the model context protocol (MCP) that standardizes how AI models interact with tools, APIs, databases, and services, acting as a universal adapter.
Configure a context file to guide the language model as a tester, enforce framework rules, avoid hallucinations, and generate manual or automation test cases from user stories and UI mockups.
Explore how OpenAI pursues artificial general intelligence to benefit humanity, develops shared principles and protocols, and powers products like ChatGPT, Copilot, and DALL-E with GPT models.
Create an n8n workflow with a chart trigger and an AI agent using OpenAI GPT-4.1 mini to read a Google sheet, filter Sam, and send an email.
Create a dynamic email workflow in n8n that reads sheet data, uses an AI agent to select the recipient, and sends emails only when a valid address exists.
Build and refine an n8n workflow that reads data from sheet two in google sheets, and triggers emails for background verification when status is S, dynamically selecting each user's email.
Navigate Jira and Zephyr setup for testing by creating an Atlassian account, generating an API token, and configuring a project, boards, and test management.
Learn to build an n8n workflow that reads test data from a sheet and creates Jira issues, including configuring Jira credentials, connecting to cloud Jira, and handling common connection issues.
Demonstrate building an n8n workflow to automatically create Jira bugs from new status entries in the Lucky Trainings project, including credential setup and defect description extraction.
Expose a public chat in an n8n workflow, using a generated URL to interact, while validating a Google Sheets-based defect workflow that creates issues in zero.
Create a chrome extension for recording and playback actions using Cursor AI, generate test scripts in Playwright TypeScript or Selenium Java, and download or clear recorded actions.
Generate test cases from a user story using defined rules and action keywords; include end-to-end journeys and edge cases, then save as md drafts viewable in Libby Manual Agent UI.
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.
Post questions in the questions tab to receive responses within 24 hours, and I will offer weekend one-on-one sessions for unresolved issues or student-requested topics.
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.
Install Python on Mac by downloading installer from python.org/downloads, running through setup prompts, and verifying with python3 --version and pip3 --version after confirming Python appears in the user bin.
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.
Install PyDev via Eclipse help marketplace, restart the editor, switch to the Python perspective, configure the Python interpreter, and create a Python demo project to run scripts.
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.
Continue exploring Python logical operators and special operators like is, is not, in, and not in, with practical code examples demonstrating comparisons and memory checks.
Explore Python strings: definition, indexing to fetch characters, immutability, reassigning whole values, string comparison with ==, concatenation with +, and built-in methods like upper, lower, and startswith.
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 how tuples are immutable, access elements by index and negative index, and edit values by converting to a list and back, while using membership tests and count.
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.
Learn how functions enable code reusability, using def to define with parameters, returning results, and calling across tests; distinguish user defined from built in functions and imports.
Explain the scope of variables, highlighting local versus global variables and the need to call a function to update a global variable using the global keyword.
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.
Learn how to use Python lambda functions as small anonymous expressions for single-line operations, replacing def and return with a concise syntax, including an example of summing two numbers.
You can download HOMEBREW from brew official website
Configure appium python by setting up Android Studio and Xcode with an Apple developer account, then update environmental variables in bash or jet profile for Android home, platform-tools, and tools.
Reset the apm setup to clear configurations, then uninstall drivers and plugins and migrate from Appium 2 to Appium 3 by installing apm 3.x globally and verifying version 3.2.2.
learn to install apm drivers and plugins using the apm installer, including ui automator 2 for android and xui test driver for ios, and use inspector to identify elements.
Validate the Appium Python and Selenium compatibility matrix in your PyCharm setup to ensure mobile automation works with remote driver options and find by mechanisms, preventing class not found errors.
Connect a real Android phone to the laptop via usb, enable developer options and usb debugging, then mirror the device with visor and verify it via adb.
Links to download app files:
1. https://github.com/saucelabs/sample-app-mobile/releases
2. https://github.com/webdriverio/native-demo-app/releases
Launch the Appium inspector plugin to start the server, connect via the inspector URL, and explore session building, capability saving, and element interaction with app screenshots for mobile automation.
Learn to launch Android and iOS apps with Python using Appium 3, configuring desired capabilities and UI Automator 2 or XCUITest options, and starting the Appium server.
Launch a native app with Appium and Python, locate elements by xpath, and interact with a button and text field using click, send keys, and basic session management.
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.
Learn to attach to an apm inspector session by enabling the session discovery flag on the apm server and using the attach session dropdown to view android and ios sessions.
Explore screen coordinates, including x and y positions, height and width, and learn how to retrieve them for swipe, scroll, and tap actions using ADB shell with practical examples.
Learn how to compute an element’s center by using its x and y coordinates, width and height, and how to click the center using real-world examples in 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()
Perform tap and long press actions in mobile automation using actions chain and touch actions, locating elements by XPath, navigating API demos views, expandable list, and custom adapter.
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.
Master handling hybrid apps by switching from native context to web view, listing contexts, and interacting with web views via Chrome inspector and xpath.
Learn to automate system apps like camera and calculator with Appium by defining app package and app activity, launching, waiting, and terminating, and using keycode inputs.
Handle web apps by launching a mobile Chrome browser, inspecting elements with Chrome inspect, and using selenium-like commands to load bing.com and enter text, with synchronization considerations.
Download the swag labs iOS simulator app and the ui kit catalog from GitHub, then run the ui kit catalog on the iPhone 17 Pro simulator.
Capture the iOS simulator ud id in Xcode by selecting the simulator in manage run destinations, copying its identifier, and using it in your program with app os version 26.4.1.
Optimize iOS web driver agent setup on mac by selecting integration app, web driver agent lib, and web driver agent runner; enable automatic signing and build/install steps to run tests.
Establish a session for the UIKitCatalog app on an iPhone 16 Pro with iOS 18.2 using Appium inspector, setting udid, platform name, platform version, and app path, then save capabilities.
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.
Discover how to automate picker views in Appium with Python by selecting a picker view, using accessibility ids, and adjusting color components and date/time pickers with send keys and XPath.
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.
Apply Appium with Python to tap using coordinates by using the action builder and pointer input to click the continue button and reveal the form.
Leverage a single code path to scroll on both Android and iOS apps, using screen coordinates, action chain, pointer input, and AW3 actions to perform scroll up and down.
Learn to automate a safari browser in an ios appium workflow by launching safari, navigating web pages, locating elements by id or xpath, and entering credentials to log in.
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
Define precondition and post condition using pytest fixtures and decorators, with function-level and module-level setup and teardown, scope and yield for teardown.
Define a pytest test with setup and teardown that creates a global Appium driver, launches the iPhone simulator's UI catalog app, and stops the Appium server after confirming the launch.
Parameterize iOS Appium tests with pytest to drive sign-up data from multiple sets (username and email) and reuse an existing test flow for two data iterations.
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 how to configure allure on mac, install homebrew, set up allure in PyCharm, and install the Allure Pi tester package to generate multi-language reports for mobile automation.
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.
Use Python and OpenCV to read QR code content from a base64 screenshot, employing a QR code detector to decode and extract the URL or data.
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.
Learn to build a Python utility to read and write Excel data by reading row and column counts, retrieving cell data, and updating cells across sheets.
Navigate GitHub to manage a repository with branches and commits. Set up git, sign in, and sync GitHub with PyCharm to share your APM Python project via the initial commit.
Learn how to build a scalable Appium Python framework with separate packages for tests, page locators, and utilities, plus data-driven testing, config handling, and allure reports.
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.
Demonstrates converting a test to data-driven, parameterized testing with Getdata, passing usernames and emails, launching the app, filling the sign-up form, and running two data sets.
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.
Build linked Jenkins pipelines across demo, deployment, testing, and release builds for continuous integration. Configure triggers and visualize flow so each job runs after the previous succeeds.
Configure python in vscode by installing the python extension, opening a project, and using github copilot to generate code; run with code runner and set python 3 as executor.
Configure Appium MCP in Visual Studio Code for GitHub Copilot by creating an mcp.json, specifying npx arguments, and defining Android home to enable code generation in Java and Python.
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.
Discover swipe up and swipe down gestures on iPhone with the Appium gestures plugin in Python, including element strategies, swipe methods, and testing on the Swag Labs app.
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()
Master long press in Appium inspector gestures by selecting an element and pressing for four seconds to reveal options, with UI and inspector updates confirming the gesture.
Apply a double tap gesture in Appium Inspector by uploading a gesture JSON, defining pointer down and up actions with brief waits to toggle a checkbox.
Learn to perform scroll operations in Appium inspector using gestures, moving from an element to a target, with pointer down and up and coordinate-based speed control.
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
This course contains the use of artificial intelligence.
Master Mobile Automation Testing using Appium 3 with Python and learn how modern Artificial Intelligence (AI) is transforming software testing and automation.
This comprehensive hands-on course is designed for QA engineers, automation testers, SDETs, developers, and beginners who want to learn the latest Appium 3 framework using Python for automating Android and iOS mobile applications.
Starting from the fundamentals, you will gradually build your knowledge of Appium 3 architecture, mobile automation concepts, and Python programming required for automation testing. You will automate both Android and iOS applications using real-world examples and practical exercises.
One of the key highlights of this course is learning how to connect and execute automation tests on real iPhone devices, providing valuable hands-on experience with real device testing. You will also learn cloud execution using SauceLabs, making your automation skills relevant for enterprise projects.
This course introduces modern Artificial Intelligence concepts and demonstrates practical AI-driven implementation to improve automation development, increase productivity, and simplify testing workflows. You'll understand how AI is becoming an essential part of software testing and how to leverage it effectively.
Topics Covered
Appium 3 Architecture
Latest Appium 3 Features
Python for Automation Testing
Android Mobile Automation
iOS Mobile Automation
Real iPhone Device Setup & Execution
Appium Inspector
Mobile Locators
Advanced Mobile Gestures
Desired Capabilities
Driver Configuration
Mobile Automation Framework Design
Test Execution and Reporting
SauceLabs Integration
AI-Driven Automation Implementation
AI Concepts for Test Automation
Industry Best Practices
Real-world Automation Examples
This course focuses on practical learning with step-by-step explanations and hands-on demonstrations to help you build confidence in mobile automation testing.
Whether you're starting your automation journey or upgrading your existing skills, this course will help you master Appium 3, Python, Android Automation, iOS Automation, Real Device Testing, AI-powered automation, and modern testing practices used by leading software companies.