SoapUI 性能测试
测试控件
测试的框架如下图所示,一个 TestCase 包含 Test Steps(具体的测试步骤)、Load Tests(设置测试线程的属性)以及安全测试,本文主要对前两个阶段进行详细说明。
大体结构如下,TestCase 中 包含着以下几个东西:
- Test Steps:具体的测试步骤
- Load Tests:设置测试线程的属性
- 安全测试

配置 JDBCRequest
我们需要从数据库里拿数据,所以我们需要配置 JDBCRequest

配置 Property Transfer
然后需要将上面数据库查到的结果,映射到 webservice request 中去,一一对应

SOAPRequest
Property Transfer 中的东西会填充到请求参数中

LoadTest
可以设置一些运行参数,比如线程数,延迟数
运行后可以统计每个运行的时间

Apifox 性能测试
待测试接口
这里我准备待测试接口,他们的返回数据很多,我想通过批量运行的方式,去测它们的性能

自动化测试
进入到 自动化测试 界面,并添加 测试用例

填写测试用例的基本信息

添加接口
接着把待测接口导入到测试用例里面去

设置参数
这里我设置一下循环次数为 100,就是为了看看 100 次接口,要用时多少

100次 只耗时 1.6s
点击 运行 开始测试,我们发现结果 100 次只耗时 1.6s,说明这个接口性能还是不错滴~

Apifox
Apifox 是一体化 API 协作平台,可以实现 API 文档、API 调试、API Mock、 API 自动化测试,是更先进的 API 设计/开发/测试工具。
Apifox 提供了一种全面的 API 管理解决方案。使用 Apifox ,你可以在统一的平台上设计、调试、测试以及协作你的 API,消除了在不同工具之间切换和数据不一致的问题。

个人使用体验还是不错的,推荐使用~