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元素包 ...
随机推荐
- SQL优化系列——索引
索引可能是数据库中最被误解的主题,因为有很多方式让你糊涂索引如何工作,以及服务器如何使用它们.要正确设计索引,让索引在数据库服务器中满足以下三个重要目的:1,索引使服务器查找一组相邻行,而不是单独的行 ...
- CentOS7安装配置PostgreSQL9.6
本文涉及CentOS7下PostgreSQL9.6的yum安装,访问配置及简单使用. 一.验证环境 1. 操作系统 CentOS-7-x86_64-Everything-1511 2. Postgre ...
- Zabbix 更改监控项的应用级
- 一个源文件可以写出多个class吗?编译后,会不会生成多个class文件?
会.一个.java源文件里面可以有内部类.其他类(有且仅有一个类可以声明为public),所以编译后,可以有多个class文件.
- 利用队列Queue实现一个多并发“线程池”效果的Socket程序
本例通过利用类Queue建立了一个存放着Thread对象的“容器对象”,当Client端申请与Server端通信时,在Server端的“链接循环”中每次拿出一个Thread对象去创建“线程链接”,从而 ...
- sqlite之多线程总结
12.android 多线程数据库读写分析与优化 11.多线程操作Sqlite? ==== 11.android 多线程数据库读写分析与优化 最新需要给软件做数据库读写方面的优化,之前无论读写,都是用 ...
- [UE4]Transform镜面翻转
- Centos 6.5(64位) vim 8.0 安装
转自:https://blog.csdn.net/sdoyuxuan/article/details/78825912 1 先得安装nurses库 yum list | grep "ncur ...
- ZooKeeper系列(9):ZooKeeper实现分布式Barrier和Queue
1. 快速开始 1.1概述: Zookeeper是Hadoop的一个子项目,它是分布式系统中的协调系统,可提供的服务主要有:配置服务.名字服务.分布式同步.组服务等. 1.2 使用常见 1.2.1 统 ...
- jscs sublime 插件配置 .jscsrc 文件
{ "disallowEmptyBlocks": true, "disallowKeywordsOnNewLine": ["else", & ...