appium1.5后不支持find_element_by_name元素定位方法,会抛如下错误

org.openqa.selenium.InvalidSelectorException: Locator Strategy 'name' is not supported for this session

解决方法如下:

找到appium\node_modules\appium-android-driver\build\lib\driver.js 文件,修改以下内容,增加'name'

mac在(/usr/local/lib/node_modules/appium/node_modules/appium-android-driver/build/lib/

修改前:this.locatorStrategies = ['xpath', 'id', 'class name', 'accessibility id', '-android uiautomator'];

修改后:this.locatorStrategies = ['xpath', 'id', 'class name', 'accessibility id', '-android uiautomator','name'];

相关文章:

  • 2022-12-23
  • 2021-06-12
  • 2021-11-27
  • 2021-05-31
  • 2021-06-27
  • 2021-09-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
  • 2021-10-20
  • 2022-12-23
  • 2021-07-27
  • 2021-07-16
相关资源
相似解决方案