简体   繁体   中英

best way to do data driven testing with different req body using rest assured java

I have a request body like

{
  "Data": {
    "Permissions": [
      "ReadOnly"
    ],

    "CreationTime": "2099-09-14T10:28:33.722Z",
      },
  "standards": {  },
  "testing":{  }
}

I want to run a data driven testing using rest assured where I pass different values for permissions and creation time etc.. What is the best way to do that? I want to have only one request model but need to write a helper method to change the values by passing the field key name and value. Very much appreciate your help

Either you can create property file (something like inputdata.properties) or using excel sheet also you can call the data and iterate through all the rows of excel sheet. You can follow below link:-

https://www.callicoder.com/java-read-excel-file-apache-poi/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM