元素定位 与web自动化一样,app自动化元素定位也是非常重要的一环,,appium也是提供了很多元素定位的方法,比如:id.name.class.层级定位等等. 元素定位方式 id name class List定位 相对定位 Xpath定位 H5页面元素定位 Uiautomator定位 首先可以进入SDK中的tools文件夹中打开uiautimatorviewer.bat,用于元素定位 测试场景,启动淘宝app,同意温馨提示,进入首页 id定位 Appium中可以使用find_element…
name定位 driver.find_element_by_name('飞利浦净水').click() 测试结果报错:selenium.common.exceptions.InvalidSelectorException: Message: Locator Strategy 'name' is not supported for this session 一开始以为写错了,后面通过搜索资料才知道,name这个定位方法,appium从1.5版本后就已经抛弃了... 所以可以通过其他定位方式来完成.…
运行自动化代码,appium返回Could not parse UiSelector argument: 'XXX' is not a string,其中的xxx就是定位的元素 解决方案:外侧用 '' (单引号) ,里面的字符串用 " " (双引号) 参考: https://blog.csdn.net/qq544649790/article/details/83960311…
运行app自动化代码时报"Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server..." 解决方案: 不使用appium默认的端口号 4723,将端口号改为4725,启动可运行.…