自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(67)
  • 收藏
  • 关注

原创 cucumber

取消test Case下pom.xml文件的勾选。feature文件无法跳转Java代码。

2024-03-01 21:13:37 411

原创 cucumber ,运行feature一直提示 Undefined step: Given login baidu

也有成功create dedintion。

2023-07-21 13:57:35 485

原创 解决报错Exception in thread “main“ java.lang.NoClassDefFoundError: org/openqa/selenium/HasAuthentication

selenium

2023-03-03 15:02:43 2439

原创 来点动力吧,存够300W退休

存够300W

2023-03-01 16:36:12 184

原创 解决IEDA Page requested without authorization, you can copy URL and open it in browser to trust it.

解决报错EDA Page 'http://localhost:63342/T…rc/main/webapp/hello.html' requested without authorization, you can copy URL and open it in browser to trust it.

2023-02-21 18:05:04 287

原创 IDEA testng study

testng

2023-02-02 16:40:05 108

原创 Android SDK安装配置学习

Android SDK 配置学习

2022-07-01 10:54:39 551

原创 java环境变量设置

java环境变量设置

2022-06-21 14:44:35 111

原创 java+selenium+截图

java+selenium+截图

2022-06-14 17:57:14 351

原创 maven 简单设置

1 Idea 设置:设置JDK设置MAVEN:setting-build-mavenmaven home directory选maven文件夹的路径user settings files 选maven路径-conf\setting.xml执行:升级插件mvn conpile -U编译:mvn install -Dmaveb.test.skip=true生成报告之前:mvn clean compile test -comile -U......

2022-05-12 17:08:57 155

原创 Chrome -Console-调试xpth

$x(“xpath”)➕enter 键

2022-02-22 17:36:53 273

原创 python学习笔记(12)configparser练习:读取配置文件

读取配置文件方法import configparserimport osdef get_ini_value(key,value): config=configparser.ConfigParser() path=os.path.abspath(os.path.dirname(os.getcwd())) + "\conf\conf.ini" config.read(path, encoding='utf-8') try: return config[k

2021-06-25 16:20:59 112

原创 pytest生成两种报告的方式

第一种import pytestimport osif __name__ == "__main__": pytest.main(['-v', 'test_pjy_pinjuan.py', '--html=./report/test_report.html']) # 报告里面更详细可以看到返回的text第二种import pytestimport osif __name__ == "__main__": pytest.main(['-v', '-q', '--alluredi

2021-06-25 16:17:09 219

原创 pytest参数化parametrize小练习

import pytestname1=1name2=2@pytest.mark.parametrize("loginname", [name1, name2])class Test_demo(): def test_demo(self,loginname): assert name1 == 1 assert name2 == 2pytest.main(['-v', 'test_demo.py', '--html=./report/test_report

2021-06-25 16:14:00 230

原创 高级测试or自动化测试面试总结

1、为什么要换工作?2、如何设计测试用例?会举一个列子发问,比如下载一个文件之类(自动化和功能都会问)3、测试流程4、如何质量保障5、什么场景需要做性能测试,性能测试关注哪些指标?6、定位元素xpath相关的问题7、定位元素遇到哪些问题?8、怎么设计流程复杂的场景的自动化UI或接口测试用例?9、如果判断一个功能要不要实现自动化。...

2021-06-21 17:10:01 162

原创 笔试题

打印九九乘法表for i in range(1,10): for j in range(1,i+1): print(i,'*',j,'=',i*j,end='\t') # print('{}x{}={}\t'.format(j, i, i * j), end='') print("")

2021-05-25 11:29:39 77

原创 发送邮件

import smtplibfrom email.header import Headerfrom email.mime.text import MIMETextsmtoserver='.com'user='@.com'password=''reciver=''mail_title='nihao你好'f = open('allure-report/index.html', 'rb') # HTML文件默认和当前文件在同一路径下,若不在同一路径下,需要指定要发送的HTML文件的路径ma

2021-05-14 18:28:19 175

原创 安装报错pip install pymssql: ERROR: No matching distribution found for setuptools>=54.0

安装报错pip install pymssql: ERROR: No matching distribution found for setuptools>=54.0

2021-05-12 09:00:38 9917 1

原创 python+selenium 定位元素踩过的坑

1、隐藏的元素定位一组元素,发现报错:selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable检查写的定位方法没发现问题,后来发现页面上只有3个找出来有9个。加上代码显示成功了,原来元素有些是隐藏的,虽然没搞明白为啥有隐藏的# for input_ in inputs1:# if input_.get_attribute("text") == "1" and i

2021-04-23 18:24:51 1403 2

原创 python笔试题,统计中文,英文字符、数字、空格、其他字符的数量

test_str = "张是s s4 444,"kong = 0 # 空格数量han = 0 # 汉字数量zi = 0 # 字母数量shuzi = 0 # 数字qita = 0for i in test_str: if i.isspace(): kong += 1 elif '\u4e00' <= i <= '\u9fff': han += 1 elif i.isdigit(): shuzi += 1

2021-04-08 15:19:31 340

原创 pycharm踩坑:明明已经用pip安装了某个库,但是import却未生效

原因在于没有设置勾选:Inherit global sit-packages 中文解释:继承全局sit包设置后就可以用了,可以发现:pip安装的库都在目录下:Python35\Lib\site-packages项目的下载的库都在:pytest_allure\venv\Lib\site-packages下...

2021-04-07 15:15:14 1564

原创 pytest 测试类Class的运用

编写pytest测试用例有一条规则:测试类要以Class开头,首字母大写一直没明白测试类用来干嘛的后来看到一篇文章才明白可以把一些要一起执行的用例放在一个测试类里面应该是方便后面的时候归类已经只执行此测试类的测试用例吧import pytestclass Testone(): a=1 def test_one(self): assert 2 == 2 def test_two(self): b=Testone() pr

2021-04-07 14:26:31 5506 1

原创 pytest学习2 https://docs.pytest.org

1、使用pytest,文件、类、函数不能随意命名,必须按照其规则进行命名,否则pytest无法识别。2、测试文件以test_开头(以_test结尾也可)3、测试类以Test开头,注意,Test首字母要大写4、测试类名称后面直接跟冒号,而不能有()5、测试类不能带有 init 方法6、测试类里的每个函数都必须有参数(self)7、测试函数以test_开头,注意,这时首字母要小写8、断言使用基本的assert即可https://docs.pytest.org...

2021-04-06 18:00:37 276

原创 PytestUnknownMarkWarning: Unknown pytest.mark.T1 - is this a typo? You can register custom marks to

新建一个配置文件,pytest.ini 重新运行测试用力即可

2021-04-06 17:52:45 1571 1

原创 pytest-标记只执行有标记的用例:pytest.mark.T1,支持多个标记,以及不执行某个标记

只执行是 pytest -v -m “mark” 不执行pytest -v -m " not mark"import pytest@pytest.mark.T1def test_mark1(): assert 1==1def test_mark2(): assert 1==1pytest.main(['-v', '-m','T1', 'test_mark.py','--html=./mark_report.html'])

2021-04-06 17:26:00 1604

原创 python接口自动化(1)——测试数据存放在excel,测试结果写入excel

有几个注意的点,excel里面的数据要用双引号因为:1、get请求传params需要是dict EXCEL里面的数据拿到的是str,所有要转成dictjson.loads(data)可以将str转成dict 前提是数据里面键值对要用双引号2、post请求传data需要是str,所以直接拿就好不用转,假如要把dictr转成str,用到的是json.dumps(data)import requestsimport jsonimport xlrdimport xlsxwriter as xls

2021-03-30 20:59:22 1338 1

原创 selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate elemen

有的时候定位元素,反复检查写的代码没问题啊,但是就是定位不到,后来发现是页面没加载到,设置隐式等待时间就解决了。driver.implicitly_wait(5)

2021-03-23 08:54:01 1349

原创 python学习笔记(11)json.dumps(data)的应用

post请求需要把data传参处理一下:json.dumps(data)import allureimport requestsimport jsonfrom comm import commonimport pytestimport configparserimport pytestimport os@allure.feature("登录")@pytest.mark.run(order=1)def test_login(): with allure.step("登录第一步"

2021-03-17 17:13:27 684

原创 jmeter:登录接口性能测试,用户名和密码读取csv

第一步第二步:设置配置第三步,在请求中应用参数${}第四步,设置线程数,不然只会读取csv的第一行的数据。注意csv数据,第一列是第一个参数的数据,第二列是第二个参数的数据。

2021-03-04 14:23:24 1226 1

原创 python学习笔记(10)xlrd+xlwt+base64,读取excel内容,获取base64码,生成xls文件

import base64import xlrdimport xlwtpath=r"C:\Users\Desktop\用户.xlsx"path1=r"C:\Users\Desktop\yonghu.xls"#获取base64码def base(name): a=base64.b64encode(name.encode("utf-8")) return str(a,"utf-8")base("1")def readEcl(path): book=xlrd.ope

2021-03-04 13:59:22 557 1

原创 python学习笔记(9)pytest+requests+allure练习,接口自动化测试加生成测试报告

import requestsimport jsonimport pytestimport allure#添加@allure.feature("添加-查询-删除流程")def test_add_sel_del(): with allure.step("添加"): payload = {"name":"aaa25","type":"shoe","buyDate":"2020-10-16","positionFirst":"aa","positionSecond":"aa

2021-02-23 16:59:44 256

原创 python学习笔记(8)dict,set,tuple,list

dict1={"a":1,"b":2,'a':4}#键值对set1={"a",'b','a'}#不可重复tuple1=('a','b','c')#不可变list1=['a','b','c','a']#可重复,可变print(dict1)print(set1)print(tuple1)print(list1)运行结果:{‘b’: 2, ‘a’: 4}{‘b’, ‘a’}(‘a’, ‘b’, ‘c’)[‘a’, ‘b’, ‘c’, ‘a’]dict:字典 {}set:集合 {}t

2021-02-22 15:24:07 79

原创 python学习笔记(7)读取文件:txt,word,excel

import xlrdfrom docx import Documentimport docx#文档路径path_word = r"C:\Users\Desktop\test.docx"path_txt = r"C:\Users\Desktop\test.txt"path_excel=r"C:\Users\Desktop\test.xlsx"#todo 读取docx#获取文档对象 以下两种写法都可以file=docx.Document(path_word)file=Document(p

2021-02-21 16:58:29 190

原创 python报错:UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xae in position 14: illegal multibyte se

读取txt 报错,加上encoding='utf-8’就可以解决了#todo 读取txtwith open(path_txt,encoding='utf-8') as a: print("a.read()>>>>>>>>>>",a.read())

2021-02-21 16:35:33 769

原创 python学习笔记(6)Flask模块运用-web开发-读取txt

read_txt.pyfrom flask import Flask, request, render_templateread_txt = Flask(__name__)@read_txt.route('/signin', methods=['get','POST'])def signin(): path = r"C:\Users\Desktop\text.txt" data = "" with open(path, encoding='utf-8') as filen

2021-02-20 18:15:44 376 2

原创 python学习笔记(4)xlsxwriter模块运用,创建105万行excel

import xlsxwriterimport randomimport gcfrom datetime import datetimeC:\Users\测试数据_105万.xlsx"kaoshengnum=1060000#创建目标excel文档xl=xlsxwriter.Workbook(path)#todo 创建sheet1考生测试信息sheet_ceshi=xl.add_worksheet("信息")#选择题数量xuanze_end=5#填空题数量tiankong_en

2021-01-15 18:01:50 136 1

原创 python学习笔记(4)plt模块运用,用于年终总结柱状图制作

直接上效果图import matplotlib.pyplot as pltimport numpy as npdef auto_text(rects): for rect in rects: ax.text(rect.get_x()+0.15, rect.get_height(), rect.get_height(), ha='left', va='bottom')fig, ax = plt.subplots()#设置字体,避免汉字乱码plt.rcParams[

2021-01-07 17:12:02 493

原创 python学习笔记(3)xlsxwriter写入90万以上数据。gc.collect()进行垃圾回收

目标创建一个90W行,43列的测试数据。重点用到gc.collect() 进行垃圾回收,如果不用这个方法会导致电脑的内存和磁盘占用到100%,整个电脑卡住,程序运行不成功import xlsxwriterimport randomimport gcfrom datetime import datetime#所有大写字母# for i in range(65,91):# print(chr(i))# #所有小写字母# for i in range(97,123):#

2021-01-07 11:24:30 730

原创 jmeter:正则表达式提取器和JSON提取器。

提取数据范例:{“retCode”:“000000”,“retMsg”:“操作成功”,“retData”:“1339179019082727426”}一、正则表达式提取器“retData”:"(.+?)"二、JSON提取器$.retData遇到问题,正则表达式提取器提取的时候提取到null值,原来没加(),对于正则表达式提取器()内的值是要提取的值。综上两种都可以提取。...

2020-12-16 20:10:00 1772

原创 TestNg优点

1、TestNg支持并行测试(通过配置testng.xml配置)在testng.xml文件中定义线程的个数:                        则开了两个线程一个运行class1,一个运行class2。...

2020-12-15 17:11:46 460

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除