We can dynamically pass the date in Date picker field instead of selecting the date from datepicker calender.
WebElement date_element = driver.findElement(By.id(locator));
((JavascriptExecutor)driver).executeScript("arguments[0].value=arguments[1]", date_element, date);
Initialise the variable date as string and assign the value in required format.
e.g String date ;
date = "01 May 2014"
WebElement date_element = driver.findElement(By.id(locator));
((JavascriptExecutor)driver).executeScript("arguments[0].value=arguments[1]", date_element, date);
Initialise the variable date as string and assign the value in required format.
e.g String date ;
date = "01 May 2014"
date_element, its locator and data are present in objectproperties file....can this code catch the data and laocator value from that file on the basis of the keyword datapicker/date_element. i havealready load the controllerexcel(keyword framework) file in the main textexecutor class.
ReplyDeletei think it should. :)
Delete