Cucumber datatable | Selenium Forum
M
Posted on 22/01/2017
List<Map<String,String>> data = table.asMaps();
@Given("^I am a \"([^\"]*)\" tester$")
public void i_am_a_tester(String arg1, DataTable arg2) throws Throwable {
// Write code here that turns the phrase above into concrete actions
// For automatic transformation, change DataTable to one of
// List<YourType>, List<List<E>>, List<Map<K,V>> or Map<K,V>.
// E,K,V must be a scalar (String, Integer, Date, enum etc)
throw new PendingException();
}
Module 24
@And("^My boss \"([a-zA-Z]{1,})\" me$")
public void My_boss_fires_me(String boss,DataTable table){
List<Map<String,String>> data = table.asMaps();

System.out.println("@And - My boss in country "+data.get(0).get("country")+" "+boss+" me");
System.out.println("@And - My boss in country "+data.get(1).get("country")+" "+boss+" me");

}

M
Replied on 22/01/2017

what is the problem?