![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
weixin_43555427
这个作者很懒,什么都没留下…
展开
-
使用python-appium-client驱动夜神模拟器
使用python-appium-client驱动夜神模拟器1、打开appium服务端,启动appium server2、打开夜神模拟器3、pycharm安装python-appium-client4、新建python file输入代码from appium import webdriverimport timedesired_caps = {'platformName':'Android','platformVersion':'5.1.1','deviceName':'127.0.0.1原创 2020-09-19 22:59:21 · 236 阅读 · 0 评论 -
python使用smtplib发送pytest html测试报告
python使用smtplib发送pytest html测试报告用例执行用时间命名pytest生成的html报告将路径传入发送邮件的函数中if __name__=='__main__': date=time.strftime('%y%m%d%H%M%S') reptadd='./report/report'+date+'.html' pytest.main(['-s','test_basic.py','-n=2','--html='+reptadd]) sendmai原创 2020-09-06 12:42:03 · 465 阅读 · 0 评论 -
python使用smtplib发送html邮件
python使用smtplib发送html邮件使用步骤1、创建smtp对象:server = smtplib.SMTP()2、连接服务器:server.connect(host=‘服务器地址’,port=端口号)3、设置debug等级:server.set_debuglevel(1)可以看到收发信息的过程4、登录验证:server.login(user_name,user_pswd)5、发送信息:server.sendmail(from_addr=fromaddr,to_addrs=toaddr原创 2020-09-06 11:09:05 · 700 阅读 · 0 评论 -
python使用smtplib发送文本邮件
python使用smtplib发送邮件使用步骤1、创建smtp对象:server = smtplib.SMTP()2、连接服务器:server.connect(host=‘服务器地址’,port=端口号)3、设置debug等级:server.set_debuglevel(1)可以看到收发信息的过程4、登录验证:server.login(user_name,user_pswd)5、发送信息:server.sendmail(from_addr=fromaddr,to_addrs=toaddrs, m原创 2020-09-05 21:48:35 · 213 阅读 · 0 评论 -
pytest执行测试用例生成html报告
pytest执行测试用例生成html报告创建测试用例import timeimport pytestdef test_01(): print("test 1 begin") assert 1==1 time.sleep(6) print("test 1 begin")def test_02(): print("test 2 begin") time.sleep(6) print("test 2 finish") assert 0 =原创 2020-09-04 23:40:21 · 719 阅读 · 0 评论 -
pytest多进程执行测试用例
pytest多进程执行测试用例创建待测用例import timeimport pytestdef test_01(): print("test 1 begin") assert 1==1 time.sleep(6) print("test 1 begin")def test_02(): print("test 2 begin") time.sleep(6) print("test 2 finish") assert 0 == 1原创 2020-09-04 23:28:07 · 1251 阅读 · 0 评论 -
使用pytest执行测试用例
使用pytest测试用例创建待测用例import pytestdef test_01(): print("test 1") assert 1==1def test_02(): print("test 2") assert 0==1 调用pytest测试用例if __name__=="__main__": pytest.main(['test_pytest.py'])执行结果============================= te原创 2020-09-04 23:16:36 · 546 阅读 · 0 评论 -
Selenium封装异常处理
Selenium封装异常处理封装异常状态的好处是可以添加自定义打印信息等,更好的记录问题、帮助定位问题class new(object): def __init__(self,driver): self.driver=driver def find(self,xpath): try: element=self.driver.find_element_by_xpath(xpath) print(xpath,"f原创 2020-09-04 17:23:06 · 207 阅读 · 0 评论 -
Selenium多进程multiprocessing的使用
Selenium多进程multiprocessing的使用导入和封装import multiprocessing as mpfrom selenium import webdriverimport timeclass basepage(object): def __init__(self,driver): self.driver=driver def page1(self): return p1(self.driver)class p1(obj原创 2020-09-02 17:29:12 · 1686 阅读 · 0 评论 -
Python多进程multiprocessing的使用
Python多进程multiprocessing的使用创建程序import multiprocessing as mpimport timedef test1(a,b): print('test1',a) time.sleep(5) print('test1 sleep finished',b)def test2(a,b): print('test2',a) time.sleep(10) print('test2 sleep finished',原创 2020-09-02 16:39:58 · 65 阅读 · 0 评论 -
Selenium类和方法的使用
Selenium类和方法的使用类的封装from selenium import webdriverimport timeclass basepage(object): def __init__(self,driver): self.driver=driver def page1(self): return p1(self.driver)class p1(object): def __init__(self,driver):原创 2020-09-02 16:21:06 · 356 阅读 · 0 评论 -
python函数与类的使用
python函数与类的使用创建函数def 函数名:(形参) 函数体 return 返回值调用函数函数名(实参)创建类class 类名称: def init(self,name,age): self.name=name &nb原创 2020-09-01 23:12:08 · 270 阅读 · 0 评论