摘要: 1、fixture 作用 1)测试用例执行的环境准备工作和清理,在 unittest 中指 setUp(),tearDown() 2)提供一种可靠和可重复性的手段去运行哪些基本的测试内容,比如登录和退出,使用fixture只用做一次。 2、固定目录 conftest.py 1)固定目录,不可更改,每 阅读全文
posted @ 2020-08-18 11:40 子非鱼焉知鱼之乐丶 阅读(626) 评论(0) 推荐(1) 编辑
摘要: 1、setup\teardown 运行级别 模块级别(setup_module/teardown_module):开始于模块始末,全局的 函数级(setup_function/teardown_function):对函数用例生效(不在类中) 类级(setup_class/teardown_class 阅读全文
posted @ 2020-08-17 14:56 子非鱼焉知鱼之乐丶 阅读(322) 评论(0) 推荐(1) 编辑
摘要: 直接上代码吧~~~~ # File : test_demo_2.py # IDE : PyCharm import pytest def setup_function(): print('*' * 10 +'用例开始!'+ '*' * 10) def teardown_function(): pri 阅读全文
posted @ 2020-08-17 14:16 子非鱼焉知鱼之乐丶 阅读(537) 评论(0) 推荐(1) 编辑
摘要: pytest 官方API说明:https://docs.pytest.org/en/latest/reference.html 1、pytest安装: pip install -U pytest -i https://pypi.tuna.tsinghua.edu.cn/simple 2、pytest 阅读全文
posted @ 2020-08-17 10:37 子非鱼焉知鱼之乐丶 阅读(858) 评论(0) 推荐(2) 编辑
摘要: demo 5 # Databaselibrary 安装:pip install robotframework-databaselibrary -i https://pypi.tuna.tsinghua.edu.cn/simple # Databaselibrary 在线文档:http://franz 阅读全文
posted @ 2020-08-14 10:47 子非鱼焉知鱼之乐丶 阅读(270) 评论(0) 推荐(1) 编辑
摘要: demo3 # 执行计算器程序 # run C:\personal\npp.7.8.9.bin.x64\notepad++.exe run calc.exe # 等待窗口出现 win wait active | [ WindowTitle | WindowText=WindowText | Time 阅读全文
posted @ 2020-08-14 09:53 子非鱼焉知鱼之乐丶 阅读(641) 评论(0) 推荐(1) 编辑
摘要: 1、将下面代码保存为 upload_file.html <html> <head> <meta http-equiv="content-type" content="text/html;charset=utf-8"/> <title>upload_file</title> <link href="h 阅读全文
posted @ 2020-08-13 17:28 子非鱼焉知鱼之乐丶 阅读(515) 评论(0) 推荐(2) 编辑
摘要: AutoIt下载地址:https://www.autoitscript.com/site/autoit/downloads/ SciTE Script Editor 脚本编写工具 AutoIt中文在线手册:https://www.jb51.net/shouce/autoit/ 1、AutoIt介绍 阅读全文
posted @ 2020-08-12 16:52 子非鱼焉知鱼之乐丶 阅读(996) 评论(0) 推荐(1) 编辑
摘要: 本来计划是使用 robot 实现上传,结果开机就入坑。 坑1:运行 ride 报错:timer can only be started from the main thread。 1)环境: widows_server2019_x64 python 3.7.8 wxpython 4.1.0 ride 阅读全文
posted @ 2020-08-11 17:28 子非鱼焉知鱼之乐丶 阅读(610) 评论(0) 推荐(1) 编辑
摘要: 1、什么是po? page object,页面即对象,将一个实现过程分成不同层。 2、po设计的好处 1)代码复用,节省代码量 2)并行开发,每个page互不影响,提高开发效率 3)测试对象和测试用例分离,维护方便 3、po设计原理 每个页面单独设计成一个类,页面中的元素作为属性,对元素的操作作为方 阅读全文
posted @ 2020-08-10 16:25 子非鱼焉知鱼之乐丶 阅读(462) 评论(0) 推荐(1) 编辑