博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Appium-We wanted {"required":["value"]} and you sent ["text","sessionId","id","value"]
阅读量:5897 次
发布时间:2019-06-19

本文共 1887 字,大约阅读时间需要 6 分钟。

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()

参考:https://www.cnblogs.com/crstyl/articles/7266341.html

转载于:https://www.cnblogs.com/hyzhang/p/10697223.html

你可能感兴趣的文章
ssh 安装笔记
查看>>
游戏音效下载网站大全
查看>>
实验五
查看>>
程序包+创建包规范+创建包体+删除程序包
查看>>
3-继承
查看>>
海归千千万 为何再无钱学森
查看>>
vue2.0 仿手机新闻站(六)详情页制作
查看>>
FreeRTOS的内存管理
查看>>
JSP----九大内置对象
查看>>
Java中HashMap详解
查看>>
Office版本差别引发的语法问题
查看>>
web前端(10)—— 浮动,清除默认样式
查看>>
ggplot2 aes函数map到data笔记
查看>>
delphi基本语法
查看>>
正则表达式匹配非需要匹配的字符串(标题自己都绕晕了)
查看>>
沙盒目录介绍
查看>>
260. Single Number III
查看>>
Hadoop生态圈-Kafka的完全分布式部署
查看>>
SOCK_STREAM & SOCK_DGRAM
查看>>
css的border的solid
查看>>