1 元素行
<input id="timeYEAR" class="config_timeset_input_2" type="text" readonly="readonly" onfocus="HS_setDate(this)" value="yyyy-mm-dd">
2 java操作
JavascriptExecutor js = (JavascriptExecutor) webdr; //获取js js.executeScript("var setDate=document.getElementById("timeYEAR");setDate.removeAttribute('readonly');"); //timeYEAR 这是ID定位元素, WebElement setDatElement=ple.getElement("xpath"); ple.getElement("xpath").clear(); ple.getElement("xpath").sendKeys("2015-02-18"); ple.getElement("xpath").click();