1、手動定位時間控件中的日期,手動選擇,其中還要切換到時間控件框架,然后再切換回來,想想就麻煩,本人不太推薦
2、一般時間控件是有readonely屬性,這里我們可以采用執行js腳本,去掉input標簽中的readonly屬性,這個時候就可以直接輸入時間,send_keys()。
image.png
js = document.getElementById().removeAttribute("readonly")
driver.execute_script(js)
3、如果時間控件readonly屬性隱藏,可以直接給value賦值
image.png
js = document.getElementById().value="2017-02"
driver.execute_script(js)