Show Menu
Cheatography

Appium Cheat Sheet Cheat Sheet (DRAFT) by

Cheat Sheet for basic appium

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Create instance of WebDrriver

from appium import webdriver

driver  = None
def create_driver(desire_capabilites, remote="https://localhost:4723/wd/hub"):
    driver = webdriver.Remote(remote,desire_capabilites)
    return driver

Basic Locators

Locating by Accessibility ID
driver.findElement(MobileBy.ACCESSIBILITY_ID("id")
Locating by Xpath
driver.findElement(By.XPATH(/Cell[contains(@value, "element'')]"
Locating by Name
driver.findElement(By.NAME("name"))
Class MobileBy is located in appium.webdriver.common.mobileby.

Desire Capabi­lites

platformName
name of os system eg.iOS Android
platformVersion
version of os system eg, 12.0
deviceName
name of device eg. iPhone XS
app
path to application eg.
Desktop/AppiumPlatformApps/aap.ipa
fullReset
True or False
udid
udid of device eg.
ff73ff07591ff985ff6f815ff4d412d2ff721495

BasicW­ebE­lement method

elemen­t.c­lick()
Click on web element
elemen­t.text
Get value from web element (STR)
elemen­t.s­end­Key­(st­ring)
Send value to element
WebDri­verWait wait = new WebDri­ver­Wai­t(d­river, 20);
wait.u­nti­l(E­xpe­cte­dCo­ndi­tio­ns.t­ex­tTo­BeP­res­ent­InE­lem­ent­Located(By.Acc,"value")"));
Explicity Wait
 
driver.ma­nag­e().ti­meo­uts­().i­mp­lic­itl­yWa­it(10, TimeUn­it.S­EC­ONDS);
Implicit Wait­
The most important and basic method which are used to control web elements