appium python andiroid自动化文档整理笔记。
利用一天时间去整理appium for android文档。传送门
利用业余时间自己翻阅资料,google。百度等去查找,费劲一番功夫,最后终于成行了这篇文档。
也是作者对最近自己的学习的一个总结吧,其实平时自己学习感觉是很简单的,可是突然让自己去整理
感觉还是很难的, 感谢自己的努力吧,感谢官网,感谢工具,感谢曾经大家的分享吧,
学习过程中,总是痛苦的,感谢那些优秀的论坛,感谢前辈们的指引,希望大家能够更多的指正。感谢。
文中代码如下展示。
from appium import webdriver
import time,unittest,HTMLTestRunner
class Testlogin(unittest.TestCase):
def setUp(self):
self.desired_caps={}
self.desired_caps['platformName'] = 'Android'
self.desired_caps['deviceName']='a6969'
self.desired_caps['preformVersion']='5.0.2'
self.desired_caps['appPackage'] = 'com.tencent.mobileqq'
self.desired_caps['appActivity'] ='.activity.SplashActivity'
self.driver=webdriver.Remote('http://localhost:4723/wd/hub', self.desired_caps)
time.sleep(2)
def tearDown(self):
self.driver.find_element_by_id('com.tencent.mobileqq:id/conversation_head').click()
self.driver.find_element_by_id('com.tencent.mobileqq:id/settings').click()
self.driver.find_element_by_id('com.tencent.mobileqq:id/account_switch').click()
self.driver.find_element_by_id('com.tencent.mobileqq:id/logoutBtn').click()
self.driver.find_element_by_id('com.tencent.mobileqq:id/dialogRightBtn').click()
self.driver.quit()
def testLogin1(self):
self.driver.find_element_by_id('com.tencent.mobileqq:id/btn_login').click() time.sleep(2)
me=self.driver.find_element_by_android_uiautomator('new UiSelector().text("QQ号/手机号/邮箱")')
me.clear()
me.send_keys('319197149')
password=self.driver.find_element_by_id('com.tencent.mobileqq:id/password')
password.clear()
password.send_keys('lileilei.930423')
self.driver.find_element_by_id('com.tencent.mobileqq:id/login').click()
m=self.driver.find_element_by_id('com.tencent.mobileqq:id/conversation_head')
if m is not None:
print('login is sucess')
else:
print('login is Flase')
print(self.driver.find_element_by_id('com.tencent.mobileqq:id/dialogText').text) if __name__ == '__main__':
suiteTest = unittest.TestSuite()
suiteTest.addTest(Testlogin("testLogin1"))
now=time.strftime('%Y-%m%d',time.localtime(time.time()))
report_dir= r'%s.html'%now
re_open= open(report_dir,'wb')
runner=HTMLTestRunner.HTMLTestRunner(stream=re_open,title='QQ测试',description='测试结果')
runner.run(suiteTest)
appium python andiroid自动化文档整理笔记。的更多相关文章
- appium python andiroid自动化文档整理笔记
from appium import webdriver import time,unittest,HTMLTestRunner class Testlogin(unittest.TestCase): ...
- appium+python+Windows自动化测试文档
appium+python自动化测试文档 一.认识appium 1. 什么是appium appium是开源的移动端自动化测试框架: appium可以测试原生的.混合的.以及移动端的web项目: ...
- golang学习笔记7 使用beego swagger 实现API自动化文档
golang学习笔记7 使用beego swagger 实现API自动化文档 API 自动化文档 - beego: 简约 & 强大并存的 Go 应用框架https://beego.me/doc ...
- python+selenium自动化软件测试(第12章):Python读写XML文档
XML 即可扩展标记语言,它可以用来标记数据.定义数据类型,是一种允许用户对自己的标记语言进 行定义的源语言.xml 有如下特征: 首先,它是有标签对组成:<aa></aa> ...
- 【转】 文档与笔记利器 reStructuredText 和 Sphinx
关于制作文档和笔记这种事,我已经纠结了很久,网上解决方案也一大推,我试过几样,ScrapBook 和 Zotero,编辑不太方便,同步麻烦.Google Note 过于格式简单,现在也不更新了,Goo ...
- Ionic2文档整理
来自:Rainey's Blog 原文地址:http://rainey.space/2016/04/06/Ionic2_Chinese_Document/ Github:https://github. ...
- Keras 文档阅读笔记(不定期更新)
目录 Keras 文档阅读笔记(不定期更新) 模型 Sequential 模型方法 Model 类(函数式 API) 方法 层 关于 Keras 网络层 核心层 卷积层 池化层 循环层 融合层 高级激 ...
- 使用Python从Markdown文档中自动生成标题导航
概述 知识与思路 代码实现 概述 Markdown 很适合于技术写作,因为技术写作并不需要花哨的排版和内容, 只要内容生动而严谨,文笔朴实而优美. 为了编写对读者更友好的文章,有必要生成文章的标题导航 ...
- Openstack python api 学习文档 api创建虚拟机
Openstack python api 学习文档 转载请注明http://www.cnblogs.com/juandx/p/4953191.html 因为需要学习使用api接口调用openstack ...
随机推荐
- PHP header使用
header()函数的作用是:发送一个原始 HTTP 标头[Http Header]到客户端.标头 (header) 是服务器以 HTTP 协义传 HTML 资料到浏览器前所送出的字串,在标头与 HT ...
- 在mac本上删除mysql
The steps: First you need to edit the file in: /etc/hostconfig and remove the line Since this is a s ...
- Android中SQLite的使用
SQLite是Android中内置的数据库,SQLite是轻量级数据库,支持标准的SQL语法,并且支持ACID事物. 在Android中提供了SQLIteOPenHelper类,帮助我们使用SQLit ...
- STM32 对内部FLASH读写接口函数(转)
源:STM32 对内部FLASH读写接口函数 因为要用内部FLASH代替外部EEPROM,把参数放在STM32的0x08000000+320K处,其中20K是bootloader,300K是应用程序. ...
- mysql root密码
方法1: 用SET PASSWORD命令 首先登录MySQL. 格式:mysql> set password for 用户名@localhost = password('新密码'); 例子:my ...
- tp框架链接数据库的基本操作
<?php namespace Admin\Controller; use Think\Controller; class MainController extends Controller { ...
- Java web入门
1.java 设计模式:http://blog.csdn.net/JAVE_LOVER/article/category/2379703 2.Java web框架的思考:http://www.osch ...
- html5 安卓拨打电话 发短信
方法一: <input name=”phone_no” format=”*m” value=”13″/> <do type=”option” label=”呼出号”> < ...
- Java Spring MVC项目搭建(三)——“Hello World”
在Spring 的配置文件里,我们定义了一个bean ,Spring 会在启动时候会生成对象. <bean id = "helloworld" class="com ...
- Python3基础 set() 删除一个列表中的重复项
镇场诗: 诚听如来语,顿舍世间名与利.愿做地藏徒,广演是经阎浮提. 愿尽吾所学,成就一良心博客.愿诸后来人,重现智慧清净体.-------------------------------------- ...