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 ...
随机推荐
- 苹果应用商店AppStore审核中文指南
目录 1. 条款与条件2. 功能3. 元数据.评级与排名4. 位置5. 推送通知6. 游戏中心7. 广告8. 商标与商业外观9. 媒体内容10. 用户界面11. 购买与货币12. 抓取与聚合13. 设 ...
- FZU 2087 统计树边
这题第一直觉就是和CF第三次教育场的E题是一样的, http://codeforces.com/contest/609/problem/E 然后直接拉过来代码改了改,提交返回MLE.FZU内存开的小, ...
- Ubuntu下搭建C++开发环境
Ubuntu使用eclipse搭建c/c++编译环境----CDT插件 Ubuntu(Linux)使用Eclipse搭建C/C++编译环境 这两天,给自己电脑弄了双系统,除了原来的W ...
- js去除字符串空格
str.replace(/\s+/g,""); str.replace(/\s|\xA0/g,""); empName=empName.replace(/^\s ...
- (简单) HDU 3397 Sequence operation,线段树+区间合并。
Problem Description lxhgww got a sequence contains n characters which are all '0's or '1's. We have ...
- HUST 1602 Substring
水题. #include<cstdio> #include<cstring> #include<cmath> #include<string> #inc ...
- EnablePrefetcher注册表项的修改与电脑提速
前些天在图书馆找教材,偶然发现一本windows dos命令应用技巧的书,发现了几个有用的注册表项 EnablePrefetcher这个注册表项是windows用来控制系统预读取数据开放程度的参数,其 ...
- IOS开发根据字体大小等获取文字所占的高度
Model *model = self.modelArr[indexPath.row]; //根据label文字获取CGRect NSMutableParagraphStyle *paragraphS ...
- IOS中APP开发常用的一些接口
免费的API接口: 1.聚合数据,上面有手机归属地查询等: 2.百度API store:上面有很多免费的接口,可以使用在自己的app中: 3.环信:提供一些用户交互的一些场景等,可以用来做即时通讯软件
- PHP利用数组构造JSON
问题起因 以往都是直接用构造数组的形式构造json 例子: $arr = array("A"=>"1","B"=>"2 ...