I am trying to pick two days after the current day of month. In my StepImplementation class, i wrote a function like this but it gives me an error:
@Step("pick two days after current day")
public void getCurrentDayOfMonth(String day) throws InterruptedException {
Calendar cal = Calendar.getInstance();
int dayOfMonth = cal.get(Calendar.DAY_OF_MONTH);
int dayToPick = dayOfMonth + 2;
day = String.valueOf(dayToPick);
appiumDriver.findElement(By.xpath("//*[@text='" + day + "']")).click();
System.out.println("Element is clicked.");
Thread.sleep(2000);
}
For my String day
parameter, it shows me this error: Parameter count mismatch(found 1 expected 0) with step annotation : 'pick two days after current day'
Basically, i am trying to pick a date for a flight from datepicker. I have to pick two days after the current day of month but i got a little bit confused.
Thanks for your help.