Appium
Appium自动化测试
kinder-balabala
测试技术交流与分享
展开
-
使用 uiautomatorviewer 获取元素的定位信息
使用 uiautomatorviewer 获取元素的定位信息。原创 2023-12-21 17:40:40 · 568 阅读 · 0 评论 -
Appium Server 启动失败常见原因及解决办法
错误原因:Appium 默认的4723端口被占用。原创 2023-12-21 16:39:39 · 1002 阅读 · 0 评论 -
Appium微信小程序自动化之开启webview调试功能方法封装
Appium在微信小程序自动化时,需要开启微信的webview调试功能,以方便对webview的元素进行定位。原创 2023-12-18 18:46:57 · 1147 阅读 · 0 评论 -
webview 的 title 和 url
在Appium以混合型App进行自动化操作时,遇到WebView时切换至WebView才能进行操作。当遇到多个WebView时,可以利用 title 和 url 切换至相应的 WebView。原创 2023-12-18 15:08:16 · 376 阅读 · 0 评论 -
Appium自动化常用adb操作封装
在Appium自动化中,经常需要使用adb命令与设备进行交互,所以有必要把常用的adb操作封装成一个类原创 2023-12-14 20:20:02 · 1153 阅读 · 0 评论 -
Appium微信小程序自动化环境准备
微信从8.0.19开始内核从x5换成xweb之后,原先的开启webview调试的原方案已经会报503错误。原创 2023-12-12 11:01:03 · 708 阅读 · 0 评论 -
Could not proxy command to the remote server. Original error: timeout of 240000ms exceeded 的解决办法
Appium 在使用华为mate 30 pro 做自动化测试时,在确定"元素在页面"的前提下,一直定位不到元素。原创 2023-12-11 19:20:04 · 515 阅读 · 0 评论 -
Appium启动微信失败的解决办法
测试环境:在使用下面代码测试启动微信时,一直不能把微信启动起来:从appium server中查找启动微信app的日志,如下:其中有这么一句:根据日志提示,尝试在 添加 之后,顺利启动微信。欢迎技术交流:原创 2023-12-09 23:12:44 · 1089 阅读 · 0 评论 -
appium 安装 uiautomator2-server-debug-androidTest.apk 、appium-uiautomator2-server-v5.12.16.apk 失败的解决办法
如果仍然安装不成功,可以手动进行安装。右键,在终端中打开,执行。原创 2023-12-09 21:32:39 · 847 阅读 · 0 评论 -
重写 AppiumService 类,添加默认启动参数,并实时显示启动日志
在Appium的1.6.0版本中引入了AppiumService类,可以很方便的通过该类来管理Appium服务器的启动和停止。经过测试,使用该类的实例执行关闭server时,并没有释放端口号,会导致第二次启动时失败。另外,使用该类启动server,不能在窗口中实时显示日志,不方便调试。因此,可以重写 AppiumService 类的 start 方法和 stop 方法,实现相应功能。原创 2023-12-08 17:45:45 · 1018 阅读 · 0 评论 -
Appium 并行测试多个设备
在自动化测试中,经常需要验证多台设备的兼容性,Appium可以用同一套测试运例并行测试多个设备,以达到验证兼容性的目的。原创 2023-12-07 23:31:29 · 1070 阅读 · 0 评论 -
python 使用 AppiumService 类启动appium server
在Appium的1.6.0版本中引入了AppiumService类,可以很方便的通过该类来管理Appium服务器的启动和停止。原创 2023-12-07 11:43:30 · 980 阅读 · 0 评论 -
Python Appium Selenium 查杀进程的实用方法
在自动化过程中,经常需要在命令行中执行一些操作,比如启动应用、查杀应用等,因此可以封装成一个CommandExecutor来专门处理这些事情。原创 2023-12-05 18:10:47 · 690 阅读 · 0 评论 -
Appium获取toast方法封装
注意:appium在v1.6.3以上才支持获取toast,并且需要指定使用Uiautomator2库。toast的class name值为。原创 2023-12-04 23:19:45 · 552 阅读 · 0 评论 -
Appium设置会话时长,解决调试代码时session失效的问题
在Appium自动化时,有时需要打断点调试自动化脚本,但经常会遇到断点调试时间过长,继续执行下一步时报错。这个问题的原因是:如果到达一定时间没有收到新的指令,Appium客户端会自动退出结束会话。原创 2023-12-04 20:21:18 · 603 阅读 · 0 评论 -
selenium 解决 id定位、class定位中,属性值带空格的解决办法
这种写法会直接报错。原创 2023-12-04 17:45:50 · 2116 阅读 · 0 评论 -
No Chromedriver found that can automate Chrome ‘x.x.xxxx‘的解决办法
在使用Appium对Android设备自动化测试时,切换WebView时抛出异常:这是因为在启动Appium时,没有指定chromedriver导致。原创 2023-12-02 23:46:04 · 943 阅读 · 0 评论 -
App自动化查看webview的元素定位信息
混合app中嵌套的webview的网页中的元素信息,使用uiautomatorviewer定位,需要转至chrome浏览器中来定位。原创 2023-12-01 21:36:26 · 510 阅读 · 1 评论 -
Error obtaining Ul hierarchy Reason: Error while obtaining Ul hierarchy XML file
Appium Session未结束,当前APP仍处于测试脚本控制之中,所以使用uiautomatorviewer定位页面时,会报"设备不存在"的错误。出现该问题,可能还有其他未知的原因,如果上面两种方法仍不能解决问题,那就重启设备、重启uiautomatorviewer。等待设备自动断开当前会话,断开的标志是:自动退出测试脚本操作的页面,回到首页。方案二:等待一段时间,让Android设备自动断开会话。方案一:使用quit()方法关闭Appium会话。原创 2023-11-30 12:19:37 · 1123 阅读 · 0 评论 -
Appium使用UiSelector封装文本定位方法find_element_by_text
Appium升级后不再支持使用name定位,我们可以使用UiSelector文本定位解决这个问题,而且UiSelector支持更加灵活的text定位方式。原创 2023-11-29 18:06:06 · 537 阅读 · 0 评论 -
Xpath层级定位方法实现find_element_by_xpath_axis
使用Xpath封装层级定位方法find_element_by_xpath_axis原创 2023-11-29 16:24:14 · 864 阅读 · 0 评论 -
Appium自动化测试swipe滑动封装
Appium 原生的swipe()方法,需要指定起始坐标点的位置,方法调用偏底层。我们可以使用get_window_size()获取窗口大小,然后按比例定义起始位置,从而实现上下左右的滑动。原创 2023-11-28 23:36:14 · 498 阅读 · 0 评论 -
pytest命令行传递参数excelpath实现数据驱动
我们可以在命令行中使用pytest传递自定义参数excelpath,然后在测试脚本中获取excelpath的路径,然后解析成数据集批量执行。原创 2023-11-28 12:04:04 · 458 阅读 · 0 评论 -
AttributeError ‘NoneType‘ object has no attribute ‘to_capabilities‘
执行test_driver()后,报错:AttributeError: ‘NoneType’ object has no attribute ‘to_capabilities’原创 2023-11-27 10:20:05 · 574 阅读 · 0 评论 -
selenium.common.exceptions.InvalidElementStateException Message Unable to perform W3C actions
在使用Appium进行swipe()滑动操作时,提示:selenium.common.exceptions.InvalidElementStateException: Message: Unable to perform W3C actions. Check the logcat output for possible error reports and make sure your input actions chain is valid.InvalidElementStateException,通常与元原创 2023-11-25 17:38:35 · 703 阅读 · 0 评论