Hi
I have a date picker field in the webpage. I am sending the values in the field with the help of java script executor in my java code. I would like to make that field data driven and pass the values through variables. I have tried in the following way:
String date1=values[2]+"/"+values[3]+"/"+values[4]+" 09:30am";
String date2=values[5]+"/"+values[6]+"/"+values[7]+" 06:30pm";
executor.executeScript("document.getElementById('rangedate__Datepicker1').value = date1");
executor.executeScript("document.getElementById('year-rangedate__Datepicker1').value = values[4]");
executor.executeScript("document.getElementById('month-rangedate__Datepicker1').value = month(values[3]");
executor.executeScript("document.getElementById('day-rangedate__Datepicker1').value = values[2]");
but i get the following error, " org.openqa.selenium.WebDriverException: JavaScript error". Can you please tell me how can i make send the values through variables in the above commands?