Articles

Articles and blog posts anything automation related

How to read key/value pairs from data table

Consider you have a feature file containing a dataTable of field/value pairs:

Can create role:
Expand Collapse Copy
Given I login as user TestUser1
    When I create the role
        | field         | value             |
        | name          | My First Role     |
        | description   | Hello World       |

If you want to read the table values out by keying on name, and description, there are a number of ways to achieve this, but one way is to transpose the dataTable:

What does "transpose" table...

 
Last edited:
Back
Top