Search code examples
javaseleniumselenium-webdrivercucumber

Cucumber DataTable .raw() no longer works (io.cucumber:4.7.2)?


Since updating to io.cucumber from info.cukes I cant seem to be able to import raw() and inturn print the value of the DataTable stored in the feature file, any ideas?

Scenario: Validate Review Count
Given I access the testimonials homepage
Then the reviews count on the testimonials page should be great than the listed total
| specified total |
| 100             |


public void test(DataTable total) throws Exception {
        List<List<String>> data = total.raw(); //the problem
        System.out.println(data.get(1).get(0));
}

Solution

  • Below method serves the same purpose in io.cucumber:

    public void test(DataTable total) throws Exception {
    
        List<List<String>> data = total.asLists(); 
        System.out.println(data.get(1).get(0));
    

    }