摘要: import unittest import paramunittest @paramunittest.parametrized( {"server": "AAA","url": "AAA_URL"}, {"server": "BBB","url": "BBB_URL"}, {"server": "CCC","url": "CCC_URL"}, ) clas 阅读全文
posted @ 2019-03-07 13:54 OTAKU_nicole 阅读(1252) 评论(0) 推荐(0) 编辑
摘要: import datetime today = datetime.date.today() print(today) #2019-02-25 #加一天 tomorrow = today + datetime.timedelta(1) print(tomorrow) #2019-02-26 #減一天 yesterday = today + datetime.timedelta(-1) pr... 阅读全文
posted @ 2019-02-25 17:19 OTAKU_nicole 阅读(647) 评论(0) 推荐(0) 编辑
摘要: import autoit from selenium import webdriver driver = webdriver.Chrome() driver.get("https://www.***.cn") # 一系列操作之后,打开了选择窗口 # 焦点到文件名选择框 autoit.control_focus("打开", "Edit1") # 选择一个文件 path = "F:\***\... 阅读全文
posted @ 2019-02-25 17:06 OTAKU_nicole 阅读(348) 评论(0) 推荐(0) 编辑
摘要: from PIL import Image from selenium import webdriver from selenium.webdriver.common.by import By driver = webdriver.Chrome() driver.get("https://www.***.cn") filename = "image.png" #截屏 driver.save_... 阅读全文
posted @ 2019-02-25 16:50 OTAKU_nicole 阅读(2772) 评论(0) 推荐(0) 编辑
摘要: from PIL import Image from pytesseract import image_to_string code = image_to_string(Image.open("code.png")) print(code) 阅读全文
posted @ 2019-02-25 16:22 OTAKU_nicole 阅读(1053) 评论(0) 推荐(0) 编辑
摘要: import smtplib from email.header import Header from email.mime.text import MIMEText def send_mail(receiver = '***@qq.com'): # 邮件服务器 smtpserver = 'smtp.163.com' # 发件人和密码 sender = '***... 阅读全文
posted @ 2019-02-18 11:39 OTAKU_nicole 阅读(793) 评论(0) 推荐(0) 编辑
摘要: import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.header import Header def send_mail(report_name, receiver ='***@qq.com'): ''' 发... 阅读全文
posted @ 2019-02-18 11:39 OTAKU_nicole 阅读(904) 评论(0) 推荐(0) 编辑
摘要: from selenium import webdriver option = webdriver.ChromeOptions() # 伪装iphone option.add_argument('--user-agent=iphone') # 伪装android # option.add_argument('--user-agent=android') driver = webdriver.C... 阅读全文
posted @ 2019-02-18 11:26 OTAKU_nicole 阅读(1569) 评论(1) 推荐(0) 编辑
摘要: import pytest class TestCase(): def setup_class(self): print("setup_class:所有用例执行之前") def setup_method(self): print("setup_method: 每个用例开始前执行") def tear 阅读全文
posted @ 2019-02-15 18:09 OTAKU_nicole 阅读(971) 评论(0) 推荐(0) 编辑
摘要: 执行顺序 setUpClass->setUp->testA->tearDown->setUp->testB>tearDown->tearDownClass 用例之间按用例名称ASCII码的顺序加载,数字与字母顺序为0~9,A~Z,a~z, 所以testA会在testB之前运行。 阅读全文
posted @ 2019-02-15 17:49 OTAKU_nicole 阅读(2672) 评论(0) 推荐(1) 编辑