随笔分类 -  Python笔记

摘要:简单介绍 python-uiautomator2是一个自动化测试开源工具,仅支持Android平台的原生应用测试。 支持平台及语言 python-uiautomator2封装了谷歌自带的uiautomator2测试框架,提供便利的python接口。他允许测试人员直接在PC上编写Python的测试代码 阅读全文
posted @ 2018-10-11 14:09 LLSix 阅读(5841) 评论(0) 推荐(0)
摘要:通过adb命令获取手机是否锁屏状态,可以通过下面指令:1.adb shell dumpsys window policy |find "isStatusBarKeyguard"2.adb shell dumpsys window policy |find "mShowingLockscreen" 已 阅读全文
posted @ 2018-09-27 17:07 LLSix 阅读(4102) 评论(0) 推荐(1)
摘要:构造方法: Thread(group=None, target=None, name=None, args=(), kwargs={}) group: 线程组,目前还没有实现,库引用中提示必须是None; target: 要执行的方法; name: 线程名; args/kwargs: 要传入方法的参 阅读全文
posted @ 2018-08-09 15:10 LLSix 阅读(2275) 评论(0) 推荐(0)
摘要:1 # coding:utf-8 2 3 4 class log(object): 5 6 def __init__(self, **kwargs): 7 ''' 8 ,:日志输出格式 9 #外层日志格式[时间,日志名,日志级别,日志信息] 10 #内层日志格式[函数名称,函数参数... 阅读全文
posted @ 2018-07-28 19:06 LLSix 阅读(778) 评论(0) 推荐(0)
摘要:1 # coding:utf-8 2 import os 3 4 cmd = {'arp': 'arp -a | find "', 5 'route': 'route PRINT ' 6 } 7 8 9 def win_mac_get(): 10 import socket 11 import re 12 s = soc... 阅读全文
posted @ 2018-07-27 17:28 LLSix 阅读(193) 评论(0) 推荐(0)
摘要:1.思维缜密的编程逻辑 2.满足明确的目的需求 3.运用现成的轮子加以改造 4.学会装饰自己的程序 5.化繁为简 6.多用配置文件作为入口 7.注意扩展兼容 阅读全文
posted @ 2018-07-12 10:32 LLSix 阅读(131) 评论(0) 推荐(0)
摘要:if __name__ == "__main__": import sys app = QtGui.QApplication(sys.argv) Form = QtGui.QWidget() ui = Ui_Form() ui.setupUi(Form) Form.show() sys.exit(app.exec_()) 阅读全文
posted @ 2018-05-27 02:33 LLSix 阅读(162) 评论(0) 推荐(0)
摘要:match 匹配string 开头,成功返回Match object, 失败返回None,只匹配一个。 search 在string中进行搜索,成功返回Match object, 失败返回None, 只匹配一个。 findall 在string中查找所有 匹配成功的组, 即用括号括起来的部分。返回l 阅读全文
posted @ 2018-04-24 15:54 LLSix 阅读(241) 评论(0) 推荐(0)
摘要:sorted(iterable, cmp=None, key=None, reverse=False) sort(cmp=None, key=None, reverse=False) 阅读全文
posted @ 2018-04-24 15:52 LLSix 阅读(646) 评论(0) 推荐(0)
摘要:返回值为dict类型 阅读全文
posted @ 2018-04-20 13:33 LLSix 阅读(355) 评论(0) 推荐(0)
摘要:通过递归解析字典,可以修改返回值的组合方式,根据需要自由修改 阅读全文
posted @ 2018-04-20 13:32 LLSix 阅读(170) 评论(0) 推荐(0)
摘要:assert 1>2,'123' 输出结果 阅读全文
posted @ 2018-03-26 14:29 LLSix 阅读(114) 评论(0) 推荐(0)
摘要:输出 阅读全文
posted @ 2018-03-26 12:16 LLSix 阅读(148) 评论(0) 推荐(0)
摘要:编辑类(Editing): Ctrl + Space 基本的代码完成(类、方法、属性)Ctrl + Alt + Space 类名完成Ctrl + Shift + Enter 语句完成Ctrl + P 参数信息(在方法中调用参数)Ctrl + Q 快速查看文档Shift + F1 外部文档Ctrl + 阅读全文
posted @ 2018-03-15 12:16 LLSix 阅读(303) 评论(1) 推荐(0)
摘要:python自动化测试中寻找元素并进行操作,如果在元素好找的情况下,相信大家都可以较熟练地编写用例脚本了,但光进行操作可能还不够,有时候也需要对预期结果进行判断。 常用 这里介绍几个常用断言的使用方法,可以一定程度上帮助大家对预期结果进行判断。- assertEqual assertNotEqual 阅读全文
posted @ 2018-02-26 17:28 LLSix 阅读(1217) 评论(0) 推荐(0)
摘要:[str(i)+'闰年' for i in range(2000,2100) if i%4 ==0 and i%100 !=0] 阅读全文
posted @ 2017-12-18 22:58 LLSix 阅读(1525) 评论(0) 推荐(0)
摘要:#coding:utf-8 ''' Created on 2017年10月25日 @author: li.liu ''' import pymysql db=pymysql.connect('localhost','root','root','test',charset='utf8') m=db.cursor() ''' try: #a=raw_input('请输入sql语句'+'\... 阅读全文
posted @ 2017-12-18 16:03 LLSix 阅读(240) 评论(0) 推荐(0)
摘要:#coding:utf-8 ''' Created on 2017��9��6�� @author: li.liu ''' from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains import os import time import re url=... 阅读全文
posted @ 2017-12-18 16:01 LLSix 阅读(367) 评论(0) 推荐(0)
摘要:#coding:utf-8 ''' Created on 2017年10月9日 @author: li.liu ''' from selenium import webdriver from lxml import etree import urllib import urllib2 import time #url='http://www.woyihome.com' url='http:/... 阅读全文
posted @ 2017-12-18 15:57 LLSix 阅读(4164) 评论(0) 推荐(0)
摘要:#coding:utf-8 ''' @author: li.liu ''' from selenium import webdriver from selenium.webdriver.common.action_chains import ActionBuilder, ActionChains from lxml import etree import urllib import time i... 阅读全文
posted @ 2017-12-18 15:50 LLSix 阅读(1587) 评论(0) 推荐(0)