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元素包 ...
随机推荐
- LeetCode——1. Two Sum
一.题目链接:https://leetcode.com/articles/two-sum/ 二.题目大意: 给定一个int型数组A和int值a,要求从A中找到两个数,使得这两个数值的和为a:返回结果为 ...
- C/C++基础----关联容器
基本属性 与顺序容器的差别,按照关键字来保存和访问,而顺序容器是按照容器中的位置来顺序保存和访问. map:每个元素是一对键值(key-valye)组合:set每个元素只包含关键字.. 每个根据关键字 ...
- C++进阶--RAII 资源获取即初始化
//############################################################################ /* 资源获取即是初始化 (RAII) * ...
- What is SolrCloud? (And how does it compare to master-slave?)
What is SolrCloud? (And how does it compare to master-slave?) SolrCloud is a set of new features and ...
- P1916小书童--大战蚂蚁
链接 题解:(这里蚂蚁0血也算活...) #include<iostream>#include<cstdio>#include<cmath>using namesp ...
- 基于scroll的吸顶效果
本次要实现的是一种常见的网页效果,如下: 页面由头部,导航,主体内容三部分组成,当页面发生滚动时,头部逐渐隐藏,导航部分向上移动,直到导航部分距离浏览器顶部为零时,导航部分固定不动,保持吸顶效果,如下 ...
- 集合--(List、Set、Map)遍历、删除、比较元素时的小陷阱
6,Map集合遍历的4中方法? 5,List遍历时如何remove元素 4.漏网之鱼-for循环递增下标方式遍历集合,并删除元素 如果你用for循环递增下标方式遍历集合,在遍历过程中删除元素,你可能会 ...
- [UE4]计算AimOffset偏移动画的角度
- win7开始菜单路径
按Win + R, 输入C:\Users\zhouwanchun\AppData\Roaming\Microsoft\Windows\Start Menu 点击确定
- python容器数据类型的特色
python容器数据类型的特色 list: 可变数据类型(不可哈希), 有序, 可索引获取, 可修改 Dict: 可变数据类型(不可哈希), 3.6版本有序, 可通 ...