The purpose of this component is to take JSON as input and return it as a data table. There are four request variables(one not mandatory) that are required to generate the output.

jsonString – to provide the JSON as input to extract as output.
prefixPadding – The padding space for the key column in table data
replacableStrings – To mention strings in a comma-separated list that needs to be replaced as an empty string. Example:ObjectId(,NumberLong(,JUUID(,),$
suffixPadding – The padding space for the key column in table data

Run the application:

Find the jar here https://github.com/Ashwin-9227/cucumber-data-generator-runnable-file
Download the jar by name cucumberdatatablegenerator-0.0.1-SNAPSHOT.jar
Place it in any folder that is accessible.
Open a command prompt and go to the appropriate destination.

If the location of the jar is in the folder is D:xxxyyy
Open command prompt, input: D:(press enter)
You will be in D: input: cd D:xxxyyy
Now you will be in D:xxxyyy

Execute the jar by using the following command. Input: java -jar cucumberdatatablegenerator-0.0.1-SNAPSHOT.jar
If you see similar to Started CucumberDataTableGeneratorApplication in 4.945 seconds (JVM running for 5.717). Then your application has started successfully.

URL to open the application

http://localhost:9887/swagger-ui.html

 

An example of how it works:

Open the URL which is provided above.
Navigate to the path as provided here.

In the jsonString body paste in the needed JSON formatted data that you need to convert into a cucumber data table.

Add the padding parameters to format the data table output

Click on execute.
Voila! now you have successfully converted JSON data in cucumber’s data table using this simple generator tool

 

This tool is the initial version where you might come across some errors while running. Try adding the unrecognized JSON parameter in replacableStrings and check it works. If it doesn’t feel free to reach me for suggestions.