摘要:pytest也是一个第三方工具的包 也需要去下载pip3 install pytest -i 源地址 然后导入pyest,编写用例:每个用例都以test_开头 每个测试用例的方法test_开头,也 运行:可以运行指定的脚本(pytest test_01.py),也可以运行整个文件夹(PS:命令为:p
阅读全文
摘要:路径:e:/pythonpro/liuyun/requesttest/requests01.py 还是现在终端cmd输入:pip3 install requests -i https://pypi.tuna.tsinghua.edu.cn/simple #导入requests import requ
阅读全文
摘要:路径:e:/pythonpro/liuyun/selenium/demo1.py 1、通过ID值: 搜索框:<input id="search-input" name="wd" type="text" placeholder="其实搜索很简单^_^ !" value="" autocomplete=
阅读全文
摘要:自动化测试分为两种:一种是UI自动化测试(selenium) :一种是接口自动化测试() selenium的步骤: 1、下载安装谷歌浏览器 2、下载谷歌的驱动() 3、安装python的selenium包(管理员模式下的终端文件) pip3 install selenium -i https://p
阅读全文
摘要:构造方法: def __init__(self) 路径: e:/pythonpro/liuyun/class02.py #——————类的构造方法——————- class person(): name ="张翰" sex = "男" #构造方法,固定的写法:初始化类 def __init__(se
阅读全文
摘要:定义方法使用def 传参使用self 路径在:e:/pythonpro/liuyun/class01.py class.py #类 #类包含了属性(特性)和方法(行为,能干啥) #普通变量 ''' a = 10 b=[] ''' #普通方法 ''' def sing(value): 写一些语句 ''
阅读全文
摘要:先安装pymysql pip install pymysql 一、写一个脚本:tools.py import pymysql ''' 1、连接数据库 2、选择数据库 3、获取游标 4、增删改查 ''' def query(sql): ''' 这是数据库的查询方法 ''' db = pymysql.c
阅读全文