- 博客(9)
- 收藏
- 关注
原创 日志自动化
import loggingimport timeimport osclass LoggingUtil: # 获取一个日志管理器 my_logger = logging.getLogger(__file__) my_logger.setLevel(logging.DEBUG) # 格式化管理器 formatter = logging.Formatter( "%(levelname)s %(asctime)s %(filename)s %(.
2021-07-08 21:16:42 148
原创 接口自动化
import requestsimport randomimport stringclass CMS: base_url = "http://192.168.31.72:8080" session = requests.session() def login(self): url = "/cms/manage/loginJump.do" data = { "userAccount": "admin", .
2021-07-08 21:16:18 381
原创 test页面
import unittestfrom selenium import webdriverfrom pages.bd_pages import BaiDuHomefrom selenium.webdriver.chrome.options import Optionsclass TestBaidu(unittest.TestCase): opt = Options() opt.headless = True # 无头(无界)模式 def test_baidu_sear.
2021-07-08 21:13:41 90
原创 run 用法
import unittestimport timefrom utils.html_test_runner import HTMLTestRunnerfrom utils.util_email import EmailUtilsuite = unittest.defaultTestLoader.discover( start_dir="./cases", pattern="test*.py")report_path = f"./reports/report_{time.st.
2021-07-08 21:12:46 209
原创 utils
邮件utilsfrom smtplib import SMTP_SSLfrom email.mime.text import MIMETextfrom email.mime.multipart import MIMEMultipartfrom email.mime.base import MIMEBasefrom email import encodersimport osclass EmailUtil: smtp_host = "smtp.qq.com" smtp_p
2021-07-08 21:11:20 80
原创 demo_utils
邮件utilsfrom smtplib import SMTP_SSLfrom email.mime.text import MIMETextsmtp_host = "smtp.qq.com"smtp_port = 465smtp_username = "1546596867@qq.com"smtp_password = "x"# 初始化一个邮件服务器连接smtp_server = SMTP_SSL(smtp_host, smtp_port)# 登录smtp_server.log.
2021-07-08 21:10:32 104
原创 basics
basics页面from selenium import webdriverfrom selenium.webdriver.remote.webdriver import WebElementfrom selenium.webdriver.support.wait import WebDriverWait as WDWfrom time import sleepclass BasePage: def __init__(self, driver: webdriver.Chrome, .
2021-07-08 21:08:33 133
原创 selenium大全
taskkill/F/IMchromedriver.exe # kill 进程# 打开浏览器driver = webdriver.Chrome()driver.get("https://baidu.com")time.sleep(1)# 1.xpath 绝对路径# bd_input = driver.find_element_by_xpath("/html/body/div/div/div[5]/div/div/form/span[1]/input")# 2.xpa...
2021-07-07 19:00:22 238
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人