selenium更改readonly属性

1.用js实现

   JavascriptExecutor removeAttribute = (JavascriptExecutor)dr; 
      //remove readonly attribute
      //removeAttribute.executeScript("var setDate=document.getElementById(\"startTime1\");setDate.removeAttribute('readonly');")

2.设置属性为false

String str = "document.getElementById(\"startTime1\").readonly=false";

posted on 2015-06-04 15:29  乔叶叶  阅读(1319)  评论(0编辑  收藏  举报

导航