摘要:
import unittest import paramunittest @paramunittest.parametrized( {"server": "AAA","url": "AAA_URL"}, {"server": "BBB","url": "BBB_URL"}, {"server": "CCC","url": "CCC_URL"}, ) clas 阅读全文
摘要:
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... 阅读全文
摘要:
import autoit from selenium import webdriver driver = webdriver.Chrome() driver.get("https://www.***.cn") # 一系列操作之后,打开了选择窗口 # 焦点到文件名选择框 autoit.control_focus("打开", "Edit1") # 选择一个文件 path = "F:\***\... 阅读全文
摘要:
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_... 阅读全文
摘要:
from PIL import Image from pytesseract import image_to_string code = image_to_string(Image.open("code.png")) print(code) 阅读全文
摘要:
import smtplib from email.header import Header from email.mime.text import MIMEText def send_mail(receiver = '***@qq.com'): # 邮件服务器 smtpserver = 'smtp.163.com' # 发件人和密码 sender = '***... 阅读全文
摘要:
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'): ''' 发... 阅读全文
摘要:
from selenium import webdriver option = webdriver.ChromeOptions() # 伪装iphone option.add_argument('--user-agent=iphone') # 伪装android # option.add_argument('--user-agent=android') driver = webdriver.C... 阅读全文
摘要:
import pytest class TestCase(): def setup_class(self): print("setup_class:所有用例执行之前") def setup_method(self): print("setup_method: 每个用例开始前执行") def tear 阅读全文
摘要:
执行顺序 setUpClass->setUp->testA->tearDown->setUp->testB>tearDown->tearDownClass 用例之间按用例名称ASCII码的顺序加载,数字与字母顺序为0~9,A~Z,a~z, 所以testA会在testB之前运行。 阅读全文