摘要: import os #读取文件数据 print(os.path.dirname(__file__)) with open('./test.txt', 'r',encoding='UTF-8') as file: content = file.readlines() file.close() 对于数据 阅读全文
posted @ 2024-04-02 19:28 小戳同学 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 一、框架目录 actions:封装业务操作链,是一个包 pages:封装各模块页面操作方法,是一个包 testcase:封装具体业务测试用例,是一个包 common:底层代码封装,比如:核心操作,文件处理,日志等,是一个包 doc:程序指南文件目录 pagefiles:页面元素定位信息,是一个目录 阅读全文
posted @ 2024-03-14 13:05 小戳同学 阅读(28) 评论(0) 推荐(0) 编辑
摘要: def multiplication_table(): content='' for i in range(1,10): row='<tr>' for j in range(1,i+1): row+=f'<td width="100">{j}*{i}={i*j}</td>' row+='</tr>' 阅读全文
posted @ 2024-03-08 13:00 小戳同学 阅读(2) 评论(0) 推荐(0) 编辑
摘要: Python 第三方库安装国内镜像汇总: 清华大学: https://pypi.tuna.tsinghua.edu.cn/simple 阿里云: http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mirrors.ustc.edu.c 阅读全文
posted @ 2024-03-08 13:00 小戳同学 阅读(64) 评论(0) 推荐(0) 编辑
摘要: 一、Allure简介 Allure是一种灵活的,轻量级,支持多语言的测试报告框架,它不仅可以以简洁的web报告形式显示已测试的内容,而且允许参与开发的每个人从测试日常执行种提取最大限度的有用信息。支持多种语言:java,python,php,.net等。 二、Allure安装 安装步骤: 1、下载a 阅读全文
posted @ 2024-03-08 12:59 小戳同学 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2024-02-23 12:35 小戳同学 阅读(1) 评论(0) 推荐(0) 编辑
摘要: #统计字符个数方法 def count_char(char,string): count=0 for c in string: if c==char: count+=1 return count char='l' string='hello world' count =count_char(char 阅读全文
posted @ 2024-02-23 12:32 小戳同学 阅读(3) 评论(0) 推荐(0) 编辑
摘要: #替换基本变量值 name='alice' age=25 message='我的名字是{},今年{}岁'.format(name,age) print(message) #格式化数字 pi=3.1415926 fromatte_ip='圆周率的近似值为{:.2f}'.format(pi) print 阅读全文
posted @ 2024-02-23 12:32 小戳同学 阅读(1) 评论(0) 推荐(0) 编辑
摘要: #密码生成 import random import string def generate_password(length): char_str=string.ascii_letters+string.digits+string.punctuation #英文,数字,特殊字符合集 password 阅读全文
posted @ 2024-02-23 12:32 小戳同学 阅读(1) 评论(0) 推荐(0) 编辑
摘要: import json #导入JSON模块 with open('data.json',encoding='utf-8') as json_file: #读取JSON文件 py_obj=json.load(json_file) #JSON文件读取到字典 with open('data1.json', 阅读全文
posted @ 2024-02-18 08:22 小戳同学 阅读(9) 评论(0) 推荐(0) 编辑