appium版本在1.5以后就不再支持ByName的定位,本文章仅介绍在appium1.6.3/1.6.4/1.6.5版本下如何支持ByName定位,适用于安卓.在使用appium1.5之后的版本时,你一定见过这个错误 org.openqa.selenium.InvalidSelectorException: Locator Strategy 'name' is not supported for this session 是否很心痛,曾经的定位神器居然ByName居然不再支持了,那我以前的脚本…
org.openqa.selenium.InvalidSelectorException: Locator Strategy 'name' is not supported for this session 1. 换其他定位方式,比如用xpath代替 2.不用换定位方式不用换之前脚本的方法来完成无缝升级appium版本的定位方式 修改源码解决问题,修改方法如下: 修改路径: C:\Users\lili\AppData\Local\Programs\appium-desktop\resources…
appium 1.7.6 不支持findElementByName(locator)  不知道为什么? 脚本中许多这样的语句,麻烦事情多了 org.openqa.selenium.InvalidSelectorException: Locator Strategy 'name' is not supported for this session (WARNING: The server did not provide any stacktrace information) *** Element…
查找路径:appium-desktop\resources\app\node_modules\appium\node_modules\appium-android-driver\build\lib 修改文件:driver.js 只需要修改其中一行即可 this.locatorStrategies = [‘xpath‘, ‘id‘, ‘class name‘, ‘accessibility id‘, ‘-android uiautomator‘,‘name‘];--------再此行代码中添加上n…
1. 换其他定位方式,比如用xpath代替 2. 使用ByAccessibilityId代替,感觉没什么效果 一招修改源码解决问题根源,修改方法如下: 找到你的appium\node_modules\appium-android-driver\build\lib\driver.js 文件,只需要修改其中一行即可 this.locatorStrategies = ['xpath', 'id', 'class name', 'accessibility id', '-android uiautoma…
前言 appium定位app上的元素,可以通过id,name.class这些属性定位到 一.id定位 1.appium的id属性也就是通过UI Automator工具查看的resource-id属性…
前言 每次自己写pageobject定位元素对象太繁琐,格式都差不多,只是换个定位方法,这种就可以才有模板的方式,批量生成pageobject定位元素对象的模板 python里面生成模板有两个模块可以选择:templet和mako 简单来说,本篇实现的目的是用代码去自动生成代码,做到代码自动化 接着上一篇讲:appium+python自动化49-yaml管理定位元素 jinja2简介 1.jinja2官方文档:官方文档 jinja2是Flask作者开发的一个模板系统,起初是仿django模板的一…
appium是使用了uiautomator的框架的,所以uiautomator所带的定位方式.appium也是支持的 需要使用appium中find_element_by_android_uiautomator()方法 示例基本都已百度app为例 1)text定位 1.通过text文本来定位 'new UiSelector().text("对应text的值")' 2.类似模糊匹配,只要包含text内容 'new UiSelector().textContains("包含tex…
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版本后就已经抛弃了... 所以可以通过其他定位方式来完成.…
今天提交代码,push到GitHub上,突然出现这个问题. remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operatio…