问题:toast元素在appium元素定位器中无法直接定位
解决方法:
1、appium-server 1.7以上的版本
2、在appium的desired_caps配置中加入参数
‘automationName’: ‘uiautomator2’
3、查找吐司文案是否存在
try:
toast_text = self.driver.find_element_by_xpath(‘//*[@text=“吐司文案}”]’)
except Exception as e:
print(e)
print(“未发现吐司,请检查”)
Appium定位toast
于 2023-10-03 18:04:40 首次发布