08 2021 档案
摘要:示例: # -*-encoding: utf-8 -*- ''' 多个测试用例执行, 但是每个用例 对初始化和清除 的要求不同 ,可以使用@pytest.fixture() fixture(scope='',params=None,autouse=False,ids=None,name=None)
阅读全文
posted @ 2021-08-31 00:13
Avicii_2018
摘要:示例: # -*-coding: utf-8 -*- from selenium import webdriver import pytest import time search_list = ['小米','小米手机','小米10s','红米','耳机'] def setup_module():
阅读全文
posted @ 2021-08-30 21:55
Avicii_2018
摘要:示例: # -*- coding: utf-8 -*- ''' 业务逻辑相同,输入参数量较大, 使用 pyetst内置装饰器@pytest.mark.parametrize('参数名',参数列表) ''' import pytest @pytest.mark.parametrize('x,y',[(
阅读全文
posted @ 2021-08-30 20:49
Avicii_2018
摘要:编写规则: 测试文件以test_开头(以_test结尾也可以) 测试类以Test开头,并且不能带有 init 方法 测试用例方法以test_开头 断言使用基本的assert即可 示例 : test_pyexample.py import pytest class TestClass: def tes
阅读全文
posted @ 2021-08-26 12:46
Avicii_2018
摘要:遇到悬浮菜单,鼠标移动,菜单就消失的情况,给元素定位造成困难,可以使用js 一次性定时器冻结页面: 在console执行 setTimeout(function(){debugger},5000) 这个定时器的意思是,在执行该定时器后5s会冻结页面, 此时在5s内将鼠标移动到目标位置,出现悬浮菜单,
阅读全文
posted @ 2021-08-24 23:26
Avicii_2018
摘要:1. 代码示例 # -*- coding: utf-8 -*- from selenium import webdriver from selenium.webdriver import ActionChains import os import time import pytest import
阅读全文
posted @ 2021-08-24 23:11
Avicii_2018
摘要:pytest提供了两套互相独立的setup 与 teardown和一对相对自由的setup与teardown 1. 模块级与函数级 模块级(setup_module/teardown_module) #开始于模块始末(不在类中) 多个用例时,执行前只需要执行一次setup_module,执行结束后执
阅读全文
posted @ 2021-08-24 21:59
Avicii_2018
摘要:1. 安装pytest pip install pytest 2. 安装allure 2.1 下载allure安装包,解压,并配置环境变量 例如: 解压路径为 D:\allure-2.13.0 , 将D:\allure-2.13.0\bin 配置到环境变量path中 Win+R 在命令行窗口中输入a
阅读全文
posted @ 2021-08-24 21:32
Avicii_2018
摘要:1. 按照tname排序,查询前10条数据 select id,tname from (select id,name from student order by tname) where rownum<=10 ; 2. 查询第100-150条记录 1. 最佳选择:利用分析函数 row_number(
阅读全文
posted @ 2021-08-23 23:15
Avicii_2018
摘要:1. 新建txt文件,文件名自定义, 如: autoreplace.txt 内容如下: 2. 将上面新建的文件放到PL/SQL Developer的安装路径中的PlugIns文件夹里. 3. 重启PL/SQL Developer,在PL/SQL Developer中进行设置: Tools > Con
阅读全文
posted @ 2021-08-16 22:25
Avicii_2018
摘要:1.等价类划分法: 等价类定义: 输入具有代表性的数据子集 等价类划分法思想: 把所有可能出现的输入条件取值一一列举出来,分类成不同的集合,从每一类集合中任意挑选一个值来进行测试即可. 等价类划分法缺点: 只考虑覆盖,不考虑组合 等价类分为: <1>有效等价类 : 满足需求的 <2>无效等价类 :
阅读全文
posted @ 2021-08-07 16:42
Avicii_2018

浙公网安备 33010602011771号