Я хочу ввести 5 разных дат в своем приложении. Для этого я сохраняю эти даты в файлах объектов. Я хочу перебрать все даты по одной
Feature File:
Scenario Outline: To test feature file iteration
Given User is on login Screen
When user enters credentials "<User_ID>" and "<Password>"
Then user enters "<processing_date>"
And clicks on logout
Examples:
| User_ID | Password |processing_date|
| Abc | Abc. |28/11/2018|
| Abc. | Abc. |03/12/2018|
Method for entering date:
public void date(DataTable date) throws Exception {
List<List<String>> data = processing_date.asList(String.class);//I had to use asList as .raw was not available)
System.out.println("Size is :" +data.size() );
for(int i=1;i<data.size();i++)
{
Thread.sleep(3000);
String scriptText = "document.querySelector('.datafield').setAttribute('value','" + date.get(i).get(i)+ "')";
((JavascriptExecutor)driver).executeScript(scriptText);
log.info("date is entered");
}
But this is not working.Is there any method to iterate feature files.Getting error as Argument mismatch.If i change DataTable date to String date and remove for loop , it works fine.But every time it login and logouts.But i want to execute all 5 dates one after the other without logging out.