WebDriver Using JS control the Calendar inputs

First get the calendar ID,

second using js to set calendar readonly attributes off or remove it.

Third set value for calendar using JS.

 

    String js="document.getElementById('train_date').removeAttribute('readOnly');document.getElementById('train_date').setAttribute('value','2014-12-25');";
    ((JavascriptExecutor) wd).executeScript(js);

 

posted @ 2014-12-08 22:34  qyzha  阅读(136)  评论(0编辑  收藏  举报