51Testing软件测试论坛
标题:
多嵌套json字符串,根据key改value
[打印本页]
作者:
测试积点老人
时间:
2022-1-18 13:22
标题:
多嵌套json字符串,根据key改value
多嵌套json字符串,根据key改value
变量
String accessToken = Bearer aaaa
<pre><code class="language-javascript">```java
{
<span class="hljs-string">"config"</span>: {
<span class="hljs-string">"name"</span>: <span class="hljs-string">"testcase description"</span>
},
<span class="hljs-string">"teststeps"</span>: [
{
<span class="hljs-string">"name"</span>: <span class="hljs-string">""</span>,
<span class="hljs-string">"request"</span>: {
<span class="hljs-string">"method"</span>: <span class="hljs-string">"POST"</span>,
<span class="hljs-string">"url"</span>: <span class="hljs-string">"xxxx"</span>,
<span class="hljs-string">"headers"</span>: {
<span class="hljs-string">"Accept"</span>: <span class="hljs-string">"*/*"</span>,
<span class="hljs-string">"Accept-Encoding"</span>: <span class="hljs-string">"gzip, deflate, br"</span>,
<span class="hljs-string">"Authorization"</span>: <span class="hljs-string">"Bearer bbbb"</span>,
<span class="hljs-string">"Connection"</span>: <span class="hljs-string">"keep-alive"</span>,
<span class="hljs-string">"Content-Length"</span>: <span class="hljs-string">"156"</span>,
<span class="hljs-string">"Content-Type"</span>: <span class="hljs-string">"application/json"</span>,
<span class="hljs-string">"Host"</span>: <span class="hljs-string">"xxxx"</span>,
<span class="hljs-string">"Postman-Token"</span>: <span class="hljs-string">"xxx"</span>,
<span class="hljs-string">"User-Agent"</span>: <span class="hljs-string">"PostmanRuntime/7.28.4"</span>
},
<span class="hljs-string">"cookies"</span>: {
<span class="hljs-string">"JSESSIONID"</span>: <span class="hljs-string">"xxxx"</span>
},
<span class="hljs-string">"body"</span>: {
<span class="hljs-string">"chunkCount"</span>: xx,
<span class="hljs-string">"fileMd5"</span>: <span class="hljs-string">"x"</span>,
<span class="hljs-string">"fileName"</span>: <span class="hljs-string">"xxx"</span>,
<span class="hljs-string">"fileSize"</span>: xx,
<span class="hljs-string">"folderName"</span>: <span class="hljs-string">"xxx"</span>,
<span class="hljs-string">"partNumber"</span>: x,
<span class="hljs-string">"uploadStatus"</span>: <span class="hljs-string">""</span>,
<span class="hljs-string">"userId"</span>: <span class="hljs-string">"xxx"</span>
}
},
<span class="hljs-string">"validate"</span>: [
{
<span class="hljs-string">"check"</span>: <span class="hljs-string">"status_code"</span>,
</code></pre>
复制代码
作者:
qqq911
时间:
2022-1-19 12:30
可以的
作者:
郭小贱
时间:
2022-1-19 14:23
只要能够定位到key就可以修改对应的value值的。
作者:
jingzizx
时间:
2022-1-19 17:33
定位就行
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2