使用get_attribute()获取元素属性,括号里应该填写什么?

查看appium源码

如果是获取resource-id,填写resourceId

self.driver.find_element(MobileBy.XPATH, "//*[contains(@resource-id,'followed_btn')]").get_attribute('resourceId')

如果是获取text,填写text,不是name,这是不准确吗?

self.driver.find_element(MobileBy.XPATH, "//*[contains(@resource-id,'followed_btn')]").get_attribute('text')


待探索

appium+python自动化:获取元素属性get_attribute的更多相关文章

  1. 获取元素属性get_attribute

    获取text # coding:utf-8 from appium import webdriver from time import sleep desired_caps = { 'platform ...

  2. Appium+python自动化12-appium元素定位

    前言 appium定位app上的元素,可以通过id,name.class这些属性定位到 一.id定位 1.appium的id属性也就是通过UI Automator工具查看的resource-id属性

  3. Appium+python自动化12-appium元素定位【转载】

    前言 appium定位app上的元素,可以通过id,name.class这些属性定位到 一.id定位 1.appium的id属性也就是通过UI Automator工具查看的resource-id属性

  4. Appium+python自动化获取toast消息的方法

    转载地址:https://www.cnblogs.com/shangren/p/8191879.html 1. 首先执行这个命令:npm install -g cnpm --registry=http ...

  5. Appium+python自动化获取toast消息(windows版)的方法

    原来用的Appium1.5.3GUI版本,那为什么升级呢? 为了兼容最新版本的iOS10和Android7 Xcode8升级后,将不支持使用UIAutomation,而是改为使用XCUITest了,并 ...

  6. appium+python自动化62-webview元素click失效问题解决

    前言 Appium 在切换到 webview 后,正确定位到元素,但是click () 事件后界面无响应,脚本运行正常不会报错. 主要原因是:混合APP 时监听全用的是tap事件,不是click事件 ...

  7. Appium+python自动化

    名称 链接地址 Appium+python自动化8-Appium Python API(上) http://mp.weixin.qq.com/s/WvpT5oRrYY22avI95FuypQ Appi ...

  8. Appium+python自动化20-查看iOS上app元素属性

    前言 学UI自动化首先就是定位页面元素,玩过android版的appium小伙伴应该都知道,appium的windows版自带的Inspector可以定位app上的元素 Mac版的appium1.6的 ...

  9. Appium+python自动化20-查看iOS上app元素属性【转载】

    前言 学UI自动化首先就是定位页面元素,玩过android版的appium小伙伴应该都知道,appium的windows版自带的Inspector可以定位app上的元素Mac版的appium1.6的版 ...

随机推荐

  1. 支持初始化数据的Zookeeper Docker镜像

    最近在做一个演示项目 https://github.com/cnscud/cavedemo, 自然为了方便, 也做了docker打包, 发现zookeeper的镜像没有导入初始化数据的功能, 于是自己 ...

  2. mongoose报错:DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead

    参考:mongoose报错:DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead mo ...

  3. C++进阶—>带你理解多字节编码与Unicode码

    参考网址:https://blog.csdn.net/u011028345/article/details/78516320 多字节字符与宽字节字符 char与wchar_t 我们知道C++基本数据类 ...

  4. C# 通过反射获取特性的值

    特性(Attribute)是用于在运行时传递程序中各种元素(比如类.方法.结构.枚举.组件等)的行为信息的声明性标签.您可以通过使用特性向程序添加声明性信息.一个声明性标签是通过放置在它所应用的元素前 ...

  5. COM笔记-COM库函数

    COM在OLE32.DLL和 OLE32.LIB定义了一些常用的函数.在使用这些函数前要先调用CoInitialize来初始化COM库.当进程不再需要使用COM库函数时要调用CoUninitializ ...

  6. python进阶(20) 正则表达式的超详细使用

    正则表达式   正则表达式(Regular Expression,在代码中常简写为regex. regexp.RE 或re)是预先定义好的一个"规则字符率",通过这个"规 ...

  7. rabbitMq可靠消息投递之交换机备份

    //备份队列 @Bean("alternate_queue") public Queue alternate_queue() { return new Queue("al ...

  8. java js转码解码

    摘自网友:https://blog.csdn.net/sgear/article/details/1509400?utm_medium=distribute.pc_relevant.none-task ...

  9. Java通过网络图片之地址,下载到服务器

    @RequestMapping("/downloadTableQrcode") public String downloadTableQrcode(HttpServletReque ...

  10. C# - 习题05_写出程序的输出结果o1.count

    时间:2017-08-24 整理:byzqy 题目:写出下列程序的输出结果: //原题程序如下: class Class1 { private static int count = 0; static ...