What is JSON?
What is cucumber data table?
A data table (or data matrix) is a special type of table that allows us to compare a set of numerical values simultaneously easily. It’s great for displaying data that you would like people to understand at a glance.
They are used for displaying numbers and statistics. Still, they can also be used as a simple way of providing information about a range of choices and doing multiple tests for a particular scenario, as we will use today.
The purpose of this component is to take JSON as input and return it as a data table.
- jsonString* – to provide the JSON as input to extract as output.
- prefixPadding* – The padding space for the key column(left) 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 value column(right) 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:\xxx\yyy
- Open command prompt, input: D:(press enter)
- You will be in D:\ input: cd D:\xxx\yyy
- Now you will be in D:\xxx\yyy
- 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.
Choosing a Global Software Development Partner to Accelerate Your Digital Strategy
To be successful and outpace the competition, you need a software development partner that excels in exactly the type of digital projects you are now faced with accelerating, and in the most cost effective and optimized way possible.
URL to open the application
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.