I used the set feature of Karate to change the values in keys using JSON expression. I used it mainly to change the request contents based on test scenarios. This gave me the capability to avoid reading lot of test data from csv files. However, still in some situations, I prefer to use csv.
For example, I have around 230 test scenarios as post requests and I have 130 different customer information which I need to use on the 230 test cases based on the context. The customer information includes first, last names, age, address etc. However, the schema is same. If I need to use something like groovy template engines what will be the best approach to use in Karate
I need to keep these data in a csv, read it and pass the values to a JSON template before I fire the request. I need to still rely on csv/ external sources because these data becomes obsolete very often and I need to change it frequently. Could you please share your thoughts on this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…