呕心沥血-花一个星期的时间写的API接口测试汇总,包含测试计划,;测试流程。测试用例设计,执行接口测试

3、在该http://101.43.158.84:5000/auth的接口的tests中,定义变量获取access_token(授权的令牌)

4、下来在接口http://101.43.158.84:5000/index的请求中添加请求头,key为Authorization value为:jwt 获取到的授权的令牌,如Authorization:jwt {{token}}

5、下来执行的顺序必须是:
先执行登录授权的接口http://101.43.158.84:5000/auth
再执行http://101.43.158.84:5000/index的接口,这样就能够获取到调用变量的值

6、必须是在collection中执行,不能单独的执行http://101.43.158.84:5000/index接口,如果单独执行,依然是401,没授权

5.Postman数据驱动

  • 概念

那么在自动化测试中(工具&代码),把共有的数据分离出来,这个思想就是数据驱动的思想,如请求地址,那么我们可以把请求地址分离出来,

  • 解决的问题

不管你的请求地址怎么变化,我只需要在一个地方进行维护

  • 实战

有一个书籍管理的业务

查看所有书籍:http://101.43.158.84:5000/v1/api/books
添加书籍:http://101.43.158.84:5000/v1/api/books
{
“author”: “wuya”,
“done”: true,
“name”: “Python接口自动化测试实战”
}
查看具体的书:http://101.43.158.84:5000/v1/api/book/{{bookID}}
删除书籍信息:http://101.43.158.84:5000/v1/api/book/{{bookID}}

我们可以发现他们的请求地址是相同的,那么我们就可以把他们的请求地址分离出来,这样不管后期请求地址怎么变换,我们只需要再一个地方管理就可以

断言的数据分离

6.Postman测试报告的生成

我们使用工具newman就可以生成测试报告(自动化测试的结果)
使用newman的前提是需要安装node.js,通过node.js来安装newman的工具
安装newman的命令:

npm install -g newman --registry=https://registry.npm.taobao.org

  • 下载安装node

检验是否安装成功

C:\Users\000>npm
npm

Usage:

npm install install all the dependencies in your project
npm install add the dependency to your project
npm test run this project’s tests
npm run run the script named
npm -h quick help on
npm -l display usage info for all commands
npm help search for help on (in a browser)
npm help npm more involved overview (in a browser)

All commands:

access, adduser, audit, bin, bugs, cache, ci, completion,
config, dedupe, deprecate, diff, dist-tag, docs, doctor,
edit, exec, explain, explore, find-dupes, fund, get, help,
hook, init, install, install-ci-test, install-test, link,
ll, login, logout, ls, org, outdated, owner, pack, ping,
pkg, prefix, profile, prune, publish, rebuild, repo,
restart, root, run-script, search, set, set-script,
shrinkwrap, star, stars, start, stop, team, test, token,
uninstall, unpublish, unstar, update, version, view, whoami

Specify configs in the ini-formatted file:
C:\Users\000.npmrc
or on the command line via: npm --key=value

More configuration info: npm help config
Configuration fields: npm help 7 config

npm@8.1.2 D:\Ruanjian\node_modules\npm

  • 安装newman

C:\Users\特昂糖>npm install -g newman --registry=https://registry.npm.taobao.org
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.

added 128 packages in 13s
npm notice
npm notice New minor version of npm available! 8.1.2 -> 8.3.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.3.0
npm notice Run npm install -g npm@8.3.0 to update!
npm notice

验证是否安装成功

C:\特昂糖>newman

Usage: newman [options] [command]

Options:
-v, --version output the version number
-h, --help display help for command

Commands:
run [options] Initiate a Postman Collection run from a given URL or path

To get available options for a command:
newman -h

  • 生成测试报告
  • 导出测试数据

  • 进入测试数据所在本地磁盘

C:\Users\000>cd D:\Zhuomian

C:\Users\000>d:

D:\Zhuomian>dir
驱动器 D 中的卷是 本地磁盘
卷的序列号是 60B8-2ACA

D:\Zhuomian 的目录

2022/01/08 23:45

.
2022/01/08 23:45
2022/01/05 11:50 a
2022/01/05 09:39 143,171,304 charlesproxy.rar
2022/01/07 16:35 28,020,736 node-v16.13.1-x64.msi
2022/01/08 23:45 26,442,630 node-v16.13.1-x64.rar
2022/01/05 14:56 116,785,528 Postman-win64-8.7.0-Setup.exe
2021/12/21 09:15 python
2022/01/07 17:06 5,443 书籍管理.postman_collection.json
2021/10/13 22:35 头像
2022/01/04 17:37 红包
5 个文件 314,425,641 字节
6 个目录 95,791,566,848 可用字节

  • 生成测试报告

View Code

2.1请求方法

2.2请求地址

2.3请求头

2.4请求参数

2.4.1GET请求的请求参数(GET请求的请求参数与请求头中的请求参数格式没有任何关系)

2.4.2POST请求的请求参数
  • JSON格式请求参数

  • 表单格式请求参数

2.5Postman测试断言

3.接口测试工具JMeter的使用

3.1项目的创建

3.1.1线程组

相当于文件夹,在这个文件夹下可以创建新的测试用例或者新的文件夹

3.1.2简单控制器:实现分组

3.1.3测试用例的添加

3.2请求方法

3.2 请求地址

不需要写http,可以全部写到路径那里

3.3请求头

控制元件—HTTP信息头管理器

3.4请求数据

3.4.1 GET请求的请求数据

3.4.2 POST请求的请求数据

3.4.2.1JSON格式请求数据

3.4.2.2表单格式请求数据

3.4.2.3xml格式请求数据

4.Postman与JMeter处理动态参数的步骤

4.1Postman处理动态参数

    • 定义动态参数

  • 调用动态参数使用{{}}

4.2JMeter处理动态参数

    • 定义动态参数
  • JSON提取器

  • 正则表达式提取器:

  • 调用动态参数

5.API测试报告的生成

5.1Postman测试报告

我们使用工具newman就可以生成测试报告(自动化测试的结果)
使用newman的前提是需要安装node.js,通过node.js来安装newman的工具

安装newman的命令:

npm install -g newman --registry=https://registry.npm.taobao.org

1.安装node.js

下载地址:Download | Node.js  下载适合自己电脑的版本,这里我们使用Windows平台

安装:只需双击即可完成安装,在这里建议不要将路径放到C盘,这是一种安装软件的共识。并且在安装的过程中,安装向导已经帮我们完成了环境变量的注册,我们可以通过环境变量来查看

验证是否配置成功:控制台输入npm,如果显示以下数据则表示安装并且配置成功

C:\Users\000>npm
npm

Usage:

npm install install all the dependencies in your project
npm install add the dependency to your project
npm test run this project’s tests
npm run run the script named
npm -h quick help on
npm -l display usage info for all commands
npm help search for help on (in a browser)
npm help npm more involved overview (in a browser)

All commands:

access, adduser, audit, bin, bugs, cache, ci, completion,
config, dedupe, deprecate, diff, dist-tag, docs, doctor,
edit, exec, explain, explore, find-dupes, fund, get, help,
hook, init, install, install-ci-test, install-test, link,
ll, login, logout, ls, org, outdated, owner, pack, ping,
pkg, prefix, profile, prune, publish, rebuild, repo,
restart, root, run-script, search, set, set-script,
shrinkwrap, star, stars, start, stop, team, test, token,
uninstall, unpublish, unstar, update, version, view, whoami

Specify configs in the ini-formatted file:
C:\Users\000.npmrc
or on the command line via: npm --key=value

More configuration info: npm help config
Configuration fields: npm help 7 config

npm@8.1.2 D:\Ruanjian\node_modules\npm #这里显示的是软件所在本地磁盘路径

2.安装newman

node.js配置成功后我们就可以安装newman了,安装newman的命令为:npm install -g newman --registry=https://registry.npm.taobao.org

C:\Users\000>npm install -g newman --registry=https://registry.npm.taobao.org
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.

added 128 packages in 13s
npm notice
npm notice New minor version of npm available! 8.1.2 -> 8.3.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.3.0
npm notice Run npm install -g npm@8.3.0 to update!
npm notice

验证是否安装成功:

C:\000>newman

Usage: newman [options] [command]

Options:
-v, --version output the version number
-h, --help display help for command

Commands:
run [options] Initiate a Postman Collection run from a given URL or path

To get available options for a command:
newman -h

3.控制台生成测试报告

  • 首先在postman中导出测试数据

这里以我的为例,下载地址:https://files.cnblogs.com/files/blogs/713119/%E9%A3%8E%E6%9A%B4%E5%B9%B3%E5%8F%B0.postman_collection.json

  • 控制台进入导出文件所在本地磁盘路径

  • 生成测试报告

newman run +导出的测试数据文件名称

4.生成HTML的测试报告

  • 安装HTML套件

newman 支持四种格式报告文件:cli,json,html,junit

生成 html 报告时需要安装html套件,命令行中执行:

npm install -g newman-reporter-html

输出报告时使用的命令:
-r html,json,junit 指定生成html,json,xml形式的测试报告
–reporter-json-export jsonReport.json 生成json格式的测试报告
–reporter-junit-export xmlReport.xml 生成xml格式的测试报告
–reporter-html-export htmlReport.html 生成html格式的测试报告
默认生成的测试报告保存在当前目录下,如果文件名前加上路径,则保存在指定的目录下

例:输出json和html文件报告

  • 生成html测试报告

输出命令:
newman run 风暴平台.postman_collection.json -r html

输出结果展示

5.输出htmlextra报告

  • 安装htmlextra套件

npm install -g newman-reporter-htmlextra

  • 运行htmlextra套件

newman run 风暴平台.postman_collection.json -r htmlextra

  • 结果展示

  • 配置好node.js与newman
  • 导出测试用例文件
  • 安装HTML套件

npm install -g newman-reporter-html

  • 控制台进入文件所在路径
  • 运行命令:newman run +文件名  -r  html
  • 生成的测试报告在导出JSON文件的文件夹下,使用浏览器打开即可

5.2JMeter测试报告的生成

.配置ant

1.1认识ant

ant下载地址:https://ant.apache.org/bindownload.cgi

ant翻译过来是蚂蚁的意思,是优秀的Java构建工具。Apache Ant是一个Java库和命令行工具,其任务是驱动构建文件中描述为
相互依赖的目标和扩展点的进程。Ant 的主要已知用途是构建 Java 应用程序。Ant 提供了许多内置任务,允许编译、组装、测试和
运行 Java 应用程序。Ant 还可以有效地用于构建非 Java 应用程序,例如 C 或 C++ 应用程序。更一般地说,Ant可用于试验任
何类型的过程,这些过程可以用目标和任务来描述。再简单点,就是jmeter整合ant可以生成HTML的测试报告

1.2ant的环境搭建

解压zip压缩包,将压缩包放置你要放置的目录。我这里放置在D:\Ruanjian\apache-ant-1.10.1,目录结构如下:

然后将bin目录配置到Path环境变量中:

1.2.1验证环境变量

C:>ant


Buildfile: build.xml does not exist!
Build failed

C:>ant -version


Apache Ant™ version 1.10.1 compiled on February 2 2017

2.配置buid.xml文件

这里演示的是使用sina邮箱发送,QQ邮箱接收
可以将账号这些换成自己的

<?xml version="1.0" encoding="UTF8"?> 执行接口自动化测试 生成接口自动测试报告 发送自动化测试报告 ${message}

3.目录结构

3.1首先在JMeter的目录下创建一个tests的文件夹

tests中存放build.xml文件,测试脚本与生成的测试报告等

3.2在tests下创建report和script文件夹

report中存放测试报告,里面创建HTML与JTL存放不同格式的测试报告
script中存放测试的脚本

4.测试报告自动发送邮件

4.1下载自动发送邮件的jar包

https://files.cnblogs.com/files/blogs/713119/JMeter%E6%B5%8B%E8%AF%95%E6%8A%A5%E5%91%8A%E8%87%AA%E5%8A%A8%E5%8F%91%E9%80%81%E9%82%AE%E4%BB%B6%E6%8F%92%E4%BB%B6.rar

4.2将下载的jar包放到ant目录下的lib目录下

5.修改JMeter的配置文件

打开jmeter的bin目录下的jmeter.properties文件
做如下修改:
把jmeter.save.saveservice.output_format=csv修改为jmeter.save.saveservice.output_format=xml

需要删除前面的#号

6.移动ant-jmeter-1.1.1.jar文件

在apache-jmeter的extras下找到ant-jmeter-1.1.1.jar的文件移动到apache-ant-1.10.0下的lib目录下面

7.生成HTML的测试报告

7.1控制台进到我们之前创建的tests目录下

C:\Users\特昂糖>cd D:\Ruanjian\apache-jmeter-5.4.3\tests

C:\Users\特昂糖>d:

D:\Ruanjian\apache-jmeter-5.4.3\tests>

7.2输入ant即可生成测试报告

如果出现以下构建失败的错误表示没有权限,使用Windows系统以管理员身份运行控制台即可解决

BUILD FAILED
D:\Ruanjian\apache-jmeter-5.4.3\tests\build.xml:29: The following error occurred while executing this line:
D:\Ruanjian\apache-jmeter-5.4.3\tests\build.xml:56: input file D:\Ruanjian\apache-jmeter-5.4.3\tests\report\jtl\testReport202201171026.jtl does not exist

Buildfile: D:\Ruanjian\apache-jmeter-5.4.3\tests\build.xml

run:

test:
[echo] 执行接口自动化测试
[jmeter] Executing test plan: D:\Ruanjian\apache-jmeter-5.4.3\tests\script\TestDev.jmx ==> D:\Ruanjian\apache-jmeter-5.4.3\tests\report\jtl\testReport202201171030.jtl
[jmeter] 2022-01-17 22:30:01,908 main ERROR FileManager (jmeter.log) java.io.FileNotFoundException: jmeter.log (拒绝访问。) java.io.FileNotFoundException: jmeter.log (拒绝访问。)
[jmeter] at java.io.FileOutputStream.open0(Native Method)
[jmeter] at java.io.FileOutputStream.open(FileOutputStream.java:270)
[jmeter] at java.io.FileOutputStream.(FileOutputStream.java:213)
[jmeter] at org.apache.logging.log4j.core.appender.FileManager F i l e M a n a g e r F a c t o r y . c r e a t e M a n a g e r ( F i l e M a n a g e r . j a v a : 438 ) [ j m e t e r ] a t o r g . a p a c h e . l o g g i n g . l o g 4 j . c o r e . a p p e n d e r . F i l e M a n a g e r FileManagerFactory.createManager(FileManager.java:438) [jmeter] at org.apache.logging.log4j.core.appender.FileManager FileManagerFactory.createManager(FileManager.java:438)[jmeter]atorg.apache.logging.log4j.core.appender.FileManagerFileManagerFactory.createManager(FileManager.java:422)
[jmeter] at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:114)
[jmeter] at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:100)
[jmeter] at org.apache.logging.log4j.core.appender.FileManager.getFileManager(FileManager.java:182)
[jmeter] at org.apache.logging.log4j.core.appender.FileAppender B u i l d e r . b u i l d ( F i l e A p p e n d e r . j a v a : 96 ) [ j m e t e r ] a t o r g . a p a c h e . l o g g i n g . l o g 4 j . c o r e . a p p e n d e r . F i l e A p p e n d e r Builder.build(FileAppender.java:96) [jmeter] at org.apache.logging.log4j.core.appender.FileAppender Builder.build(FileAppender.java:96)[jmeter]atorg.apache.logging.log4j.core.appender.FileAppenderBuilder.build(FileAppender.java:52)
[jmeter] at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1120)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1045)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1037)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:651)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:247)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:293)
[jmeter] at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:626)
[jmeter] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:699)
[jmeter] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:716)
[jmeter] at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:270)
[jmeter] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
[jmeter] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
[jmeter] at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
[jmeter] at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)
[jmeter] at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:55)
[jmeter] at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
[jmeter] at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
[jmeter] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
[jmeter] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
[jmeter] at org.apache.jmeter.JMeter.(JMeter.java:126)
[jmeter] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[jmeter] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[jmeter] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[jmeter] at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[jmeter] at org.apache.jmeter.NewDriver.main(NewDriver.java:252)
[jmeter]
[jmeter] 2022-01-17 22:30:01,915 main ERROR Could not create plugin of type class org.apache.logging.log4j.core.appender.FileAppender for element File: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.FileManager F i l e M a n a g e r F a c t o r y @ 49139829 ] u n a b l e t o c r e a t e m a n a g e r f o r [ j m e t e r . l o g ] w i t h d a t a [ o r g . a p a c h e . l o g g i n g . l o g 4 j . c o r e . a p p e n d e r . F i l e M a n a g e r FileManagerFactory@49139829] unable to create manager for [jmeter.log] with data [org.apache.logging.log4j.core.appender.FileManager FileManagerFactory@49139829]unabletocreatemanagerfor[jmeter.log]withdata[org.apache.logging.log4j.core.appender.FileManagerFactoryData@9597028] java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.FileManager F i l e M a n a g e r F a c t o r y @ 49139829 ] u n a b l e t o c r e a t e m a n a g e r f o r [ j m e t e r . l o g ] w i t h d a t a [ o r g . a p a c h e . l o g g i n g . l o g 4 j . c o r e . a p p e n d e r . F i l e M a n a g e r FileManagerFactory@49139829] unable to create manager for [jmeter.log] with data [org.apache.logging.log4j.core.appender.FileManager FileManagerFactory@49139829]unabletocreatemanagerfor[jmeter.log]withdata[org.apache.logging.log4j.core.appender.FileManagerFactoryData@9597028]
[jmeter] at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:116)
[jmeter] at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:100)
[jmeter] at org.apache.logging.log4j.core.appender.FileManager.getFileManager(FileManager.java:182)
[jmeter] at org.apache.logging.log4j.core.appender.FileAppender B u i l d e r . b u i l d ( F i l e A p p e n d e r . j a v a : 96 ) [ j m e t e r ] a t o r g . a p a c h e . l o g g i n g . l o g 4 j . c o r e . a p p e n d e r . F i l e A p p e n d e r Builder.build(FileAppender.java:96) [jmeter] at org.apache.logging.log4j.core.appender.FileAppender Builder.build(FileAppender.java:96)[jmeter]atorg.apache.logging.log4j.core.appender.FileAppenderBuilder.build(FileAppender.java:52)
[jmeter] at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1120)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1045)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1037)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:651)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:247)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:293)
[jmeter] at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:626)
[jmeter] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:699)
[jmeter] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:716)
[jmeter] at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:270)
[jmeter] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
[jmeter] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
[jmeter] at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
[jmeter] at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)
[jmeter] at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:55)
[jmeter] at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
[jmeter] at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
[jmeter] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
[jmeter] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
[jmeter] at org.apache.jmeter.JMeter.(JMeter.java:126)
[jmeter] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[jmeter] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[jmeter] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[jmeter] at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[jmeter] at org.apache.jmeter.NewDriver.main(NewDriver.java:252)
[jmeter]
[jmeter] 2022-01-17 22:30:01,949 main ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.appender.FileAppender for element File: java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.FileAppender java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.FileAppender
[jmeter] at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod(PluginBuilder.java:236)
[jmeter] at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:134)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1120)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1045)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:1037)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:651)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:247)
[jmeter] at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:293)
[jmeter] at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:626)
[jmeter] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:699)
[jmeter] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:716)
[jmeter] at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:270)
[jmeter] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
[jmeter] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
[jmeter] at org.apache.logging.log4j.LogManager.getContext(LogManager.java:196)
[jmeter] at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:137)
[jmeter] at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:55)
[jmeter] at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:47)
[jmeter] at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:33)
[jmeter] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:363)
[jmeter] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:388)
[jmeter] at org.apache.jmeter.JMeter.(JMeter.java:126)
[jmeter] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[jmeter] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
[jmeter] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[jmeter] at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
[jmeter] at org.apache.jmeter.NewDriver.main(NewDriver.java:252)
[jmeter]
[jmeter] 2022-01-17 22:30:01,957 main ERROR Null object returned for File in Appenders.
[jmeter] 2022-01-17 22:30:01,965 main ERROR Unable to locate appender “jmeter-log” for logger config “root”
[jmeter] Creating summariser
[jmeter] Created the tree successfully using D:\Ruanjian\apache-jmeter-5.4.3\tests\script\TestDev.jmx
[jmeter] Starting standalone test @ Mon Jan 17 22:30:02 CST 2022 (1642429802382)
[jmeter] Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445
[jmeter] summary + 1 in 00:00:01 = 1.6/s Avg: 420 Min: 420 Max: 420 Err: 0 (0.00%) Active: 1 Started: 1 Finished: 0
[jmeter] summary + 23 in 00:00:05 = 4.2/s Avg: 236 Min: 105 Max: 1631 Err: 1 (4.35%) Active: 0 Started: 1 Finished: 1
[jmeter] summary = 24 in 00:00:06 = 3.9/s Avg: 243 Min: 105 Max: 1631 Err: 1 (4.17%)
[jmeter] Tidying up … @ Mon Jan 17 22:30:08 CST 2022 (1642429808769)
[jmeter] … end of run

report:
[echo] 生成接口自动测试报告

BUILD FAILED
D:\Ruanjian\apache-jmeter-5.4.3\tests\build.xml:29: The following error occurred while executing this line:
D:\Ruanjian\apache-jmeter-5.4.3\tests\build.xml:56: input file D:\Ruanjian\apache-jmeter-5.4.3\tests\report\jtl\testReport202201171030.jtl does not exist

Total time: 8 seconds

7.3生成的测试报告在我们之前创建的report下的HTML目录下

总的测试用例个数:16,成功率:93.75%,失败率:6%,
失败原因:自己代码写的不对,不是程序的问题覆盖场景:登录,产品管理,地址管理
结论:本次自动化测试完整的覆盖了登录业务,产品管理业务,地址管理业务,所有的测试场景测试通过

  • 搭建好ant的环境
  • 配置build.xml文件
  • 配置好目录结构
  • 控制台进入build.xml文件所在本地路径
  • 控制台输入ant即可生成测试报告

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数软件测试工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年软件测试全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
img
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上软件测试开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新

如果你觉得这些内容对你有帮助,可以添加V获取:vip1024b (备注软件测试)
img

一个人可以走的很快,但一群人才能走的更远。不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎扫码加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

品管理,地址管理
结论:本次自动化测试完整的覆盖了登录业务,产品管理业务,地址管理业务,所有的测试场景测试通过

  • 搭建好ant的环境
  • 配置build.xml文件
  • 配置好目录结构
  • 控制台进入build.xml文件所在本地路径
  • 控制台输入ant即可生成测试报告

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数软件测试工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年软件测试全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
[外链图片转存中…(img-quHBzkMM-1713020769146)]
[外链图片转存中…(img-PXhYgs0P-1713020769147)]
[外链图片转存中…(img-TJbLmZBt-1713020769147)]
[外链图片转存中…(img-HPFV2NxN-1713020769148)]
[外链图片转存中…(img-9bN30aqD-1713020769149)]

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上软件测试开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新

如果你觉得这些内容对你有帮助,可以添加V获取:vip1024b (备注软件测试)
[外链图片转存中…(img-nCZvASLU-1713020769150)]

一个人可以走的很快,但一群人才能走的更远。不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎扫码加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

  • 12
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值