在 WebLoad Recorder 上,我试图从 HTML 视图的“confirmationCode”中获取值“00000001”。这是 HTML 视图的样子:
{"dat0":{"application":{"test01":{"application01":0000,"confirmationCode":"00000001","timeStamp":"2021-12-16T12:06:12.6066256+00:00","__typename":"CreateApplicationResult0000"},"__typename":"ApplicationMutation"}},"extensions":{"tracin0":{"version":1,"startTime":"2021-12-16T16:06:12.2201621Z","endTime":"2021-12-16T16:06:13.0521621Z","duration":831502300,"parsing":{"startOffset":1500,"duration":40000},"validation":{"startOffset":43100,"duration":296900},"execution":{"resolvers":[{"path":["application"],"parentType":"Mutation","fieldName":"application","returnType":"ApplicationMutation","startOffset":529900,"duration":1799},{"path":["application","create"],"parentType":"ApplicationMutation","fieldName":"create","returnType":"CreateApplicationResultType!","startOffset":540500,"duration":830867300},{"path":["application","create","applicationID"],"parentType":"CreateApplicationResultType","fieldName":"applicationID","returnType":"Int!","startOffset":831450000,"duration":6799},{"path":["application","create","confirmationCode"],"parentType":"CreateApplicationResultType","fieldName":"confirmationCode","returnType":"String!","startOffset":831462000,"duration":999},{"path":["application","create","timeStamp"],"parentType":"CreateApplicationResultType","fieldName":"timeStamp","returnType":"DateTimeOffset!","startOffset":831468700,"duration":1399}]}}}}
我已阅读指南“WebLOAD JavaScript 参考指南”,但没有找到获取此信息的方法。我也尝试了一些纯javascript,但总是出错。例如,我尝试了这种语法:
InfoMessage(
CustomParams_FirstName.getValue() + " " + CustomParams_LastName.getValue() + " added." + document.body.textContent.substr(57,28)
)
并得到这个错误:
消息:TypeError:document.body 在第 123 行的 main_agenda 中没有属性
知道如何处理吗?