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. C++进阶--构造函数和析构函数中的虚函数

    //############################################################################ /* 任何时候都不要在构造函数或析构函数中 ...

  2. Lucene suggest [转]

      The Big Data Zone is presented by Splunk, the maker of data analysis solutions such as Hunk, an an ...

  3. 搜索引擎(lucene及周边) 涉及的一些算法总结

    一)分词 1)正向/逆向最大匹配算法 典型:IKAnalyzer采用的是正向迭代最细粒度切分算法 IKAnalyzer源码简单分析: http://www.cnblogs.com/huangfox/p ...

  4. Ngui Tween 组合动画 group

    使用NGUI的Tween做补间动画,难免会涉及组合各种Tween.最常用的就是 Scale+Alpha组合 做淡入淡出了.那么如何控制 播放完一个Tween 后在 播放另一个Tween呢? 利用del ...

  5. Hadoop错误集:Could not find the main class: org.apache.hadoop.*

    在搭建Hadoop机群的时候,之前遇见了很多次找不到类的错误,因为对Hadoop了解不深,所以就在网上漫无目的的找解决方案,所以这里总结下我用的方法. 解决办法一: 我之前遇到了找不到 org.apa ...

  6. Hadoop概念学习系列之Hadoop集群动态增加新节点或删除已有某节点及复制策略导向 (四十三)

    不多说,直接上干货! hadoop-2.6.0动态添加新节点 https://blog.csdn.net/baidu_25820069/article/details/52225216 Hadoop集 ...

  7. IIS性能优化篇

    首先程序的优化,不只是沿着一个点进行,往往都是程序配合服务器及数据服务器配置提升性能. 第一步:数据库链接优化 在数据库链接字符串中添加“Max Pool Size=32767;”,32767是数据库 ...

  8. Flink安装启动

    1.下载安装包并解压 下载网址:https://flink.apache.org/ 版本选择可以根据安装的hadoop版本和Scala版本进行选择 我用的是:flink-1.3.3-bin-hadoo ...

  9. document.write的用处!

    document.write是JavaScript中对document.open所开启的文档流(document stream操作的API方法,它能够直接在文档流中写入字符串,一旦文档流已经关闭,那d ...

  10. UnicodeString基本操作(Ring3)

    // Unicode_String_Ring3.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include "Unicode ...