随笔分类 - web自动化测试
摘要:#参数化库: ddt 前提:安装ddt库,>>> python -m pip install ddt import unittest from ddt import ddt, data,unpack from selenium import webdriver from time import sl
阅读全文
摘要:#参数化库: parameterized 前提:先安装patameterized库 >>>python -m pip install parameterized from selenium import webdriver import unittest from time import sleep
阅读全文
摘要:from selenium import webdriver import unittest from time import sleep class TestSearch(unittest.TestCase): @classmethod #基于类级别只开启一次浏览器,执行当前目录下所有用例 def
阅读全文
摘要:#count_01.py class Count: def add(self,a,b): return a + b #testcase_01.py import unittest from count_01 import Count #1、必须创建测试类,且必须继承unittest.TestCase
阅读全文
摘要:读取本地user_info.csv文件内容 import csv #导入csv包 import codecs #导入编码格式,因为导入的csv文件里若有中文字符的话解析失败 from itertools import islice #itertools迭代器模块 #islice(iterable,
阅读全文
摘要:#testcase_01.py from selenium import webdriver from time import sleep from login_module import Login dr = webdriver.Chrome() #测试数据与测试代码分离: user_info =
阅读全文
摘要:from selenium import webdriver from time import sleep """ dr = webdriver.Chrome() dr.get("https://mail.qq.com/") sleep(3) #多表单切换 #对于frame/iframe表单嵌套(多
阅读全文
摘要:from selenium import webdriver #1、鼠标悬停,导入提供鼠标操作的 ActionChains 类 from selenium.webdriver.common.action_chains import ActionChains from time import slee
阅读全文
摘要:webdriver提供八种元素定位方法: 前提:安装python, vscode, selenium, webdriver(谷歌浏览器驱动) from selenium import webdriver from time import sleep dr = webdriver.Chrome() d
阅读全文

浙公网安备 33010602011771号