Appium-We wanted {"required":["value"]} and you sent ["text","sessionId","id","value"]
APK 链接:https://pan.baidu.com/s/17oeTM1qA0QjPBqLh6pS0Yg
提取码:s9ru # coding:utf-8
from appium import webdriver
import time,traceback
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '4.4.4'
desired_caps['deviceName'] = 'test'
desired_caps['app'] = r'c:/Appium/toutiao.apk'
desired_caps['appPackage'] = 'io.manong.developerdaily'
desired_caps['appActivity'] ='io.toutiao.android.ui.activity.LaunchActivity'
desired_caps['unicodeKeyboard'] = True
desired_caps['resetKeyboard'] = True
desired_caps['noReset'] = True
desired_caps['newCommandTimeout'] = 6000 driver = webdriver.Remote('http://localhost:4723/wd/hub',desired_caps)
driver.implicitly_wait(15)
try:
driver.find_element_by_class_name("android.widget.ImageButton")
time.sleep(5)
xpath = '//*[@resource-id = "io.manong.developerdaily:id/tab_bar"]//android.widget.RelativeLayout[5]//android.widget.TextView'
driver.find_element_by_xpath(xpath).click() # eles = driver.find_elements_by_xpath('//*[@resource_id="io.manong.developerdaily:id/tab_bar"]//android.widget.TextView')
# for ele in eles:
# print ele.text
# eles[3].click() #python time.sleep(3)
driver.find_element_by_id('io.manong.developerdaily:id/login_btn').click()
time.sleep(2)
driver.find_element_by_xpath('//*[@resource-id="io.manong.developerdaily:id/tab_layout"]//android.widget.RelativeLayout[2]//android.widget.TextView').click()
ele = driver.find_element_by_id('io.manong.developerdaily:id/edt_phone')
ele.set_value('13717617074')
time.sleep(3)
ele = driver.find_element_by_id('io.manong.developerdaily:id/edt_password')
ele.set_value('mao112233')
time.sleep(2)
driver.find_element_by_id('io.manong.developerdaily:id/btn_login').click()
except:
print traceback.print_exc()
input('****Press to quit..')
driver.quit()
send_keys () 参数不正确问题解决
参考:https://www.cnblogs.com/crstyl/articles/7266341.html
Appium-We wanted {"required":["value"]} and you sent ["text","sessionId","id","value"]的更多相关文章
- We wanted {"required":["value"]} and you sent ["text","value","id","sessionId"]
重装python pycharm后再次执行以前执行没有问题的Appium脚本报错 We wanted {"required":["value"]} and yo ...
- Appium Mac 命令行安装
试过很多方法都失败,打算用命令行方式安装. 准备工作: 从 https://github.com/appium/appium下载appium版本的源码(.tar) 详见github_Appium1.6 ...
- appium运行遇到的坑01
..... File "build\bdist.win32\egg\appium\webdriver\errorhandler.py", line 29, in check_res ...
- 一个完整的Appium手机自动化测试实例
实现过程: 1.使用环境 appium .安卓SDK .python 本文重点是自动化实例,环境搭建过程省略. 2.找到被测APP的包名和Activity Name 手机连接上电脑后,在DOS环境先使 ...
- Appium的一些问题的总结答案
问题 1. error: Failed to start an Appium session, err was: Error: Requested a new session but one ...
- python + appium 执行报错整理
1.driver.find_element_by_id("com.taobao.taobao:id/searchEdit").send_keys("adidas" ...
- 【Mac + Appium + Python3.6学习(二)】之Android自动化测试,appium-desktop配置和简易自动化测试脚本
上一篇文章介绍安装appium测试环境,这一片研究介绍如何测试Android自动化. 上一篇地址:<[Mac + Appium学习(一)]之安装Appium环境> 这一篇参考:<Ma ...
- appium使用错误集合
原因:没有加载该文件 解决方案: cmd 使用:adb shell uiautomator dump 在cmd生成 然后就可以获取元素了 使用send_keys()输入报错 selenium.c ...
- [HTML/HTML5]9 使用表单
9.1 创建基本表单 表单都具有相同的基础结构.即它都包含表单的的开始标记<form>和结束标记</form>.<input>控件和处理表单的方法.form元素包 ...
随机推荐
- mongoDB oplog的说明及应用
mongoDB oplog 说明 ts:8字节的时间戳,由4字节unix timestamp + 4字节自增计数表示.这个值很重要,在选举(如master宕机时)新primary时,会选择ts最大的那 ...
- SVM的sklearn实现
转载:豆-Metcalf 1)SVM-LinearSVC.ipynb-线性分类SVM,iris数据集分类,正确率100% """ 功能:实现线性分类支持向量机 说明:可以 ...
- 【ZZ】技能表合集
技能表 http://w.itcodemonkey.com/tag/373.html 1 当一名黑客应该学什么?来看看安全工程师技能表 2 软件测试工程师技能表 3 大数据.数据挖掘技能表 4 C/C ...
- 廖雪峰Java4反射与泛型-3范型-5extends通配符
1.泛型的继承关系: Pair<Integer>不是Pair<Number>的子类 add()不接受Pair<Integer> Pair.java package ...
- setjmp的跳转
** 问 :goto语句只能在函数内使用,那如果想要在函数内部直接跳到函数外怎么办呢?** ** 答:setjmp跳转 介绍: 举例: #include<stdio.h> #include ...
- Java zxing生成二维码所需的jar包
免费的,不需要积分. 共有2个jar包, 链接: https://pan.baidu.com/s/1QJcEkRQOp1NdrNAgGC6LvQ 密码: 4524
- Linux上面的MTU含义
问题场景描述: 最近在搞一个很菜的程序--FTP上传文件. 但是这个 很菜的程序搞的我脑袋疼了 半个月. 在linux上面部署了我的程序,上传文件在1KB以下顺利上传,但是1KB以上上传不上去. 程序 ...
- maven入门安装及HelloWorld实现
一.安装maven 1.下载 https://maven.apache.org/download.cgi 官网进行下载 2.安装 2.1 解压 本人在D盘建立一个maven文件夹,然后 ...
- Submline Text 3插件sublimeTmpl添加新模板
1.安装 一般安装Package Control 2.插件 添加模板 1).进入Preferences->Browse Packages->SublimeTmpl->template ...
- 在html中使用thymeleaf编写通用模块
在编写页面时,常常会需要用到通用模块,比如header部分.footer部分等. 项目前端使用的是themeleaf模板引擎,下面简单介绍下使用themeleaf写header通用模块: 1. 通用部 ...