随笔分类 -  自动化

自动化相关,如unitest,selenium,定位等等
摘要:1. 隐式等待 driver.implicity_wait(10) 2. 线程等待 sleep(3) 3. 显式等待 from selenium import webdriver from selenium.webdriver.common.by import By from selenium.we 阅读全文
posted @ 2021-01-18 17:12 静惜 阅读(727) 评论(0) 推荐(0)
摘要:import unittest from ddt import ddt, data, unpack, file_data data1 = ((1, 2, 3), (4, 5, 6)) data2 = [{'name': 'tom', 'score': 90}, {'name': 'jane', 's 阅读全文
posted @ 2021-01-18 16:14 静惜 阅读(77) 评论(0) 推荐(0)
摘要:1 import time 2 from selenium import webdriver 3 driver = webdriver.Chrome() 4 driver.maximize_window() 5 driver.get('https://cn.bing.com/') 6 time.sl 阅读全文
posted @ 2021-01-18 15:37 静惜 阅读(71) 评论(0) 推荐(0)
摘要:discover(start_dir,pattern='test*.py',top_level_dir=None) 找到指定目录下所有测试模块,并可递归查到子目录下的测试模块,只有匹配到文件名才能被加载。如果启动的不是顶层目录,那么顶层目录必须单独指定。 start_dir:要测试的模块名或测试用例 阅读全文
posted @ 2021-01-18 15:17 静惜 阅读(103) 评论(0) 推荐(0)
摘要:1. config 配置文件的目录 config.ini 配置文件 globalconfig.py 获得日志路径,测试用例路径,测试报告路径,测试数据路径等。 __init__.py 2. data 测试数据 TestData 测试数据路径 TestData.xlsx 3. log 日志 log.p 阅读全文
posted @ 2020-07-04 22:48 静惜
摘要:1. 运行程序的时候,报错:is not reachable by keyboard,这个密码框总是无法输入字符串, 解决办法: el = WebDriverWait(driver,10).until(EC.visibility_of_element_located((By.ID,'loginpwd 阅读全文
posted @ 2020-07-02 22:55 静惜 阅读(136) 评论(0) 推荐(0)