SoapUI 传递参数
本文章主要是通过例子,给大家讲解一下 SoapUI 发送请求时,如何带上参数~

新建工程
首先新建一个工程,然后在里面进行后续的操作。

填写工程的一些信息,比如 工程的名称。

新建测试集(测试套件)
测试集也称 测试套件(TestSuit),在一个 测试套件 中,可以有多个 测试用例。

新建测试用例
接下来就是在新建的 TestSuit 中,去新建 TestCase,也就是 测试用例,一个 测试用例 里可以有多个 接口。

新建接口
点击新建 HTTP Request。

填写传递的参数
你可以在这里填写 parameters,也就是传递的参数。

如图,携带了几个参数
- username
- password
- savelogin

Apifox 传递参数
使用 Apifox 传递参数非常简单,只需要在界面中填写即可!
前置条件
我已经在后端写了一个接口,这个接口会返回请求传递过去的参数,以此来证明后端接收到参数了。
Apifox 创建接口
创建接口分为几步:
- 点击创建接口按钮
- 设置 POST 方法,以及 URL
- 请求参数格式选择 formdata
- 填写请求参数 username、pasword

然后点击 保存 按钮。
Apifox 发送请求
到 运行 界面,发送请求,我们可以看到,后端返回的数据使我们传过去的数据,说明我们的数据传递成功了!!

Apifox 运行页修改参数
我们也可以在运行页去修改参数,随时调试!!
比如我这里修改 username

我点击 发送,我们看到结果也跟着变了!!

Apifox
Apifox 是一体化 API 协作平台,可以实现 API 文档、API 调试、API Mock、 API 自动化测试,是更先进的 API 设计/开发/测试工具,点击免费使用。
Apifox 的接口调试非常方便,它的功能不止于此,还有:
- 支持中文
- 免费试用
- 支持在线文档
- 支持 Mock
- 支持自动化测试
- 拥有 IDEA 插件 Apifox Helper
- 优质的技术解答社群
