简体   繁体   中英

How to pass raw data json format from feature file to stepdefinition file in Cucumber

I have input data as json (complex data) format and want to write cucumber to test rest api. How can I pass input json data from feature file to step definition file. I know how can i pass multiple parameters , but don't know how to pass json data. The input json is very complex and don't know whether i can read it from file in classpath.

Don't write the json data in the feature file. Instead give it a name and refer to it by that name in your scenarios.

Then use the name in your step definitions (or helper methods used by step definitions) to get the data.

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