Appium 官方 docs\finding-elements.cn.md 说 1.0 正式版会取消 by_name 方式定位,现在对中文支持的很 nice,建议向作者反应别取消该设定呀

LW · 2014年04月12日 · 最后由 Mr Wang 回复于 2014年04月15日 · 1314 次阅读

Finding and interacting with elements

Appium supports a subset of the WebDriver locator strategies:

  • find by "tag name" (i.e., ui component type)
  • find by "name" (i.e., the text, label, or developer-generated ID a.k.a 'accessibilityIdentifier' of an element) NOTE: the "name" locator strategy will be deprecated on mobile devices, and will not be a part of Appium v1.0
  • find by "xpath" (i.e., an abstract representation of a path to an element, with certain constraints)
共收到 3 条回复 时间 点赞

xpath 也可以同样做到, 所以不必可惜. 这个毕竟跟 webdriver 的协议不兼容, 所以还是要去掉的.

或者自己单独留出来做一个扩展使用也行.

#1 楼 @seveniruby 觉得应该改个名字 类似 by.linkText()

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册