Error while extracting data from datatable in cucumber | Selenium Forum
M
Posted on 16/01/2017
Hi Ashish.Currently i am working on Module-24.I am getting error while extracting data from datatable.i am using all jar files for cucumber are 1.2.5 versions.
I saw some tutorials in google about that but i didn't get that one.I stuck there.So,can you please explain me or give one example related to that.It will be very helpful to me and please tell me how to use asMaps also.


@Then("^I will get \"([a-zA-Z]{1,})\" Protiens$")
public void good_Protiens(String myQuantity,DataTable table){
List<Map<String,String>> data = table.asMaps(String.class,String.class);

APPLICATION_LOGS.debug("@Then---I am "+myQuantity+"in"+data.get(0).get("industry")+"industry in country"+data.get(0).get("country"));
APPLICATION_LOGS.debug("@Then---I am "+myQuantity+"in"+data.get(1).get("industry")+"industry in country"+data.get(1).get("country"));

APPLICATION_LOGS.debug("i will get "+myQuantity+" protiens");
}

M
Replied on 17/01/2017

[quote:29ot8u66]I am getting error while extracting data from datatable.[/quote:29ot8u66]

what is the problem? it is unclear from your post.