如何在REST保证框架中使用数据结构以JSON格式文件传递输入和验证?

发布于 2025-01-27 23:53:18 字数 884 浏览 3 评论 0原文

如何使用数据结构在REST保证框架中以JSON格式文件传递输入和验证。在下面的文件中,我将用户名和密码作为有效负载作为输入,并从JSON响应中验证不同的用户类型。

基本上,我想避免从Cucumber示例关键字和Excel文件传递数据。我希望数据从JSON格式文件传递。需要有关如何完成此操作的输入

{
 Login_Pass_1:
              {
                Input: 
                         Username:paulproux
                           password: xyz123
                Verification:
                          Usertype: admin
               }
Login_Pass_2:
             {
               Input: 
                         Username:johnrossu
                           password: abc456 
               Verification:
                          Usertype: reviewer
             }              
Login_Pass_3:
              {       
                 Input:  Username:johnrossu
                           password: sdf234
               Verification:
                          Usertype: moderator
              }

}

How to use data structures to pass Input and Verification in JSON format file in the Rest Assured framework. In the below file I am passing the Username and password as the input as the payload and verifying different User types from the JSON response.

Basically I want to avoid passing the data from Cucumber Example keyword and excel files. I want the data to be passed from JSON format file. Need inputs on how to get this done

{
 Login_Pass_1:
              {
                Input: 
                         Username:paulproux
                           password: xyz123
                Verification:
                          Usertype: admin
               }
Login_Pass_2:
             {
               Input: 
                         Username:johnrossu
                           password: abc456 
               Verification:
                          Usertype: reviewer
             }              
Login_Pass_3:
              {       
                 Input:  Username:johnrossu
                           password: sdf234
               Verification:
                          Usertype: moderator
              }

}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文