Appium脚本(4) 使用uiautomator方法定位元素
from app.find_element.capability import driver
from time import sleep # 使用uiautomator方法定位元素 accunt_input = driver.find_element_by_android_uiautomator('new UiSelector().text("请输入用户名")')
accunt_input.clear()
accunt_input.send_keys("账号123")
passwd_input = driver.find_element_by_android_uiautomator(
'new UiSelector().resourceId("com.tal.kaoyan:id/login_password_edittext")')
passwd_input.send_keys('')
sleep(2)
# driver.find_element_by_id('com.tal.kaoyan:id/login_login_btn').click() driver.close_app()
Appium脚本(4) 使用uiautomator方法定位元素的更多相关文章
- Appium之定位元素
常用的appium元素定位工具: (1)Android SDK 中提供的元素定位工具uiautomatorviewer: (2)AppiumDesktop提供的元素定位工具Appium Inspec ...
- Python+Appium自动化测试(12)-通过坐标定位元素
在使用appium做app自动化测试的过程中,可能会遇到元素的属性值不是唯一的情况,导致不能通过find_element_bi_xx()方法定位元素,这个时候我们就可以通过坐标来定位元素. 1,通过绝 ...
- Python+Selenium练习篇之3-利用tag name定位元素
前一篇文章介绍了如何通过元素的id值来定位web元素,本文介绍如何通过tag name来定位元素.个人认为,通过tag name来定位还是有很大缺陷,定位不够精确.主要是tag name有很多重复的, ...
- 【appium】根据UIAutomator定位元素
text属性的方法 driver.find_element_by_android_uiautomator('new UiSelector().text("Custom View") ...
- Appium之uiautomator定位元素
元素定位方式有多种,Android也有自身独有的定位方式.下面就单独介绍其基于uiautomator定位元素的方法: 基本语法: driver.find_element_by_android_uiau ...
- Appium Inspector定位元素与录制简单脚本
本次以微信为例, 使用Appium自带的Inspector定位工具定位元素, 以及进行最最最简单脚本的录制: capabilities = { "platformName": &q ...
- Appium脚本(5) 元素等待方法示例
思考 在自动化过程中,元素出现受网络环境,设备性能等多种因素影响.因此元素加载的时间可能不一致,从而会导致元素无法定位超时报错,但是实际上元素是正常加载了的,只是出现时间晚一点而已.那么如何解决这个问 ...
- 元素定位方法之Uiautomator方法
这个方法只能用于安卓系统,方法通过类UiSelector()来构造对象的 官网地址:https://developer.android.google.cn/topic/libraries/testin ...
- Appium python自动化测试系列之Android UIAutomator终极定位(七)
android uiautomator text定位 可能有人不知道为什么说android uiautomator是终极定位,而且android uiautomator和appium有什么关系呢?如果 ...
随机推荐
- mysql免安装版本测试(mysql-5.7.18-winx64)
最近在某大学代课要安装mysql,由于他们的电脑机器不能用installer安装(具体原因我也不清楚,一点击就显示要结束进程),在查阅了资料之后在我的小笔记本上做了一把实验,下面记录过程 参考博客为: ...
- ie下的透明度,用滤镜filter:alpha
.box{ width:100px; height:100px; background-color:#000; filter:alpha(Opacity=50); opacity: 0.5; }
- 学习:简单使用MFC创建对话框窗口
MFC介绍:微软基础类库(英语:Microsoft Foundation Classes,简称MFC)是微软公司提供的一个类库(class libraries),以C++类的形式封装了Windows ...
- day003-python初识
基本的写代码流程:1.创建 xxx.py文件 注意:文件不要保存在中文的路径下,和文件名不要以中文命名. 2.写代码 a.注意两行文件头 #! /usr/bin/env python # -*- c ...
- day001-在Windows下python环境的搭建
一.Python下载 1.Python最新源码,二进制文档,新闻资讯等可以在Python的官网查看到: 2.Python官网:https://www.python.org/ 3.你可以在以下链接中下载 ...
- ubuntu及Cenos国内镜像下载
打开:https://man.linuxde.net/download/ CentOS 7提供了三种ISO镜像文件的下载: DVD ISO 标准安装版,一般下载这个就可以了(推荐) Everythin ...
- nginx部署项目
nginx介绍 Nginx是一款轻量级的Web 服务器/反向代理服务器及电子邮件(IMAP/POP3)代理服务器,在BSD-like 协议下发行.其特点是占有内存少,并发能力强,事实上nginx的并发 ...
- 【题解】 洛谷 P2649 游戏预言
题目: P2649 游戏预言 题意: John和他的好朋基友们在van纸牌游戏.共有\(m\)个人.纸牌有\(n \times m\)张,从\(1--n \times m\)编号.每人有\(n\)张. ...
- Dice Similarity Coefficent vs. IoU Dice系数和IoU
Dice Similarity Coefficent vs. IoU Several readers emailed regarding the segmentation performance of ...
- RSA算法java实现(BigInteger类的各种应用)
一.RSA算法 1.密钥生成 随机生成两个大素数p.q 计算n=p*q 计算n的欧拉函数f=(p-1)*(q-1) 选取1<e<f,使e与f互素 计算d,ed=1modf 公钥为(e,n) ...