Cheatography
https://cheatography.com
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 Capabilites
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 |
BasicWebElement method
element.click() |
Click on web element |
element.text |
Get value from web element (STR) |
element.sendKey(string) |
Send value to element |
WebDriverWait wait = new WebDriverWait(driver, 20); wait.until(ExpectedConditions.textToBePresentInElementLocated(By.Acc,"value")")); |
Explicity Wait |
|
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); |
Implicit Wait |
The most important and basic method which are used to control web elements
|