Appium定位元素方式
XPATH定位
from selenium.webdriver.common.by import By def login(driver): el4=driver.find_element(By.XPATH,'//xpath of login') el4.click() el4.clear()
ACCESSIBILITY_ID
el11 = driver.find_element(by=AppiumBy.ACCESSIBILITY_ID, value='我的\n第 2 个标签,共 2 个')
ANDROID_UIAUTOMATOR
e2 = driver.find_element(by=AppiumBy.ANDROID_UIAUTOMATOR, value='new UiSelector().description("注销账号")')
el3=driver.find_element(by=AppiumBy.ANDROID_UIAUTOMATOR, value='new UiSelector().text("CONFIRM")')
优先使用ANDROID_UIAUTOMATOR方式,因为速度最快
 
                    
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号