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"]的更多相关文章

  1. We wanted {"required":["value"]} and you sent ["text","value","id","sessionId"]

    重装python pycharm后再次执行以前执行没有问题的Appium脚本报错 We wanted {"required":["value"]} and yo ...

  2. Appium Mac 命令行安装

    试过很多方法都失败,打算用命令行方式安装. 准备工作: 从 https://github.com/appium/appium下载appium版本的源码(.tar) 详见github_Appium1.6 ...

  3. appium运行遇到的坑01

    ..... File "build\bdist.win32\egg\appium\webdriver\errorhandler.py", line 29, in check_res ...

  4. 一个完整的Appium手机自动化测试实例

    实现过程: 1.使用环境 appium .安卓SDK .python 本文重点是自动化实例,环境搭建过程省略. 2.找到被测APP的包名和Activity Name 手机连接上电脑后,在DOS环境先使 ...

  5. Appium的一些问题的总结答案

        问题 1. error: Failed to start an Appium session, err was: Error: Requested a new session but one ...

  6. python + appium 执行报错整理

    1.driver.find_element_by_id("com.taobao.taobao:id/searchEdit").send_keys("adidas" ...

  7. 【Mac + Appium + Python3.6学习(二)】之Android自动化测试,appium-desktop配置和简易自动化测试脚本

    上一篇文章介绍安装appium测试环境,这一片研究介绍如何测试Android自动化. 上一篇地址:<[Mac + Appium学习(一)]之安装Appium环境> 这一篇参考:<Ma ...

  8. appium使用错误集合

    原因:没有加载该文件 解决方案: cmd 使用:adb shell uiautomator dump 在cmd生成   然后就可以获取元素了 使用send_keys()输入报错  selenium.c ...

  9. [HTML/HTML5]9 使用表单

    9.1  创建基本表单 表单都具有相同的基础结构.即它都包含表单的的开始标记<form>和结束标记</form>.<input>控件和处理表单的方法.form元素包 ...

随机推荐

  1. 【java】之类加载机制

    类加载: 类加载机制是指.class文件加载到jvm,并形成Class对象的机制,之后的应用就可对Class对象进行实例化并调用,类加载机制可在运行时动态加载外部的类,远程网络下载过来的class文件 ...

  2. 资源 Des加密

    Unity3d资源管理分析 http://blog.csdn.net/sgnyyy/article/details/39268215 打包资源 http://www.cnblogs.com/sifen ...

  3. Hive的安装配置 & 基础指令

    Hive 基础命令

  4. 学习笔记之DevOps

    DevOps - Wikipedia https://en.wikipedia.org/wiki/DevOps DevOps (a clipped compound of "developm ...

  5. [转][C#]Web.config 相关配置

    设置默认首页 <?xml version="1.0" encoding="UTF-8"?> <configuration> <sy ...

  6. Spring AOP 之编译期织入、装载期织入、运行时织入(转)

    https://blog.csdn.net/wenbingoon/article/details/22888619 一   前言 AOP 实现的关键就在于 AOP 框架自动创建的 AOP 代理,AOP ...

  7. [UE4]在蓝图中判断一个对象是否有效

  8. [UE4]UI动画复用

    一.创建一个专门播放动画的Widget,添加一个“Name Slot”,创建动画绑定到这个“Name Slot”. 二.要使用这个动画的widget就添加第一步创建的widget,并把需要执行动画的对 ...

  9. InfluxDB 基本认识

    一.InfluxDB 简介 InfluxDB 是用Go语言编写的一个开源分布式时序.事件和指标数据库,无需外部依赖.类似的数据库有Kairosdb.OpenTsdb等. 三大特性: 时序性(Time ...

  10. jquery选择器筛选器

    jQuery对象 Query 对象就是通过jQuery包装DOM对象后产生的对象.jQuery 对象是 jQuery 独有的. 如果一个对象是 jQuery 对象, 那么它就可以使用 jQuery 里 ...