如何使用双击编辑文本字段?

时间:2015-10-09 15:00:25

标签: java css selenium-webdriver

我想使用Selenium& amp ;;使用双击来编辑(更新,而不是完全删除)手动添加的文本Selenide使用Page对象模型。

public void EditSmth(String name){
    tasks.find(text(name)).hover().doubleClick().setValue("cow");
}

双击文本字段之前的CSS看起来像

<section id="main" data-woven="troopjs-todos/widget/display@6" style="display: block;">
   <input id="toggle-all" type="checkbox" data-woven="troopjs-todos/widget/mark@8" />
   <label for="toggle-all">Mark all as complete</label>
   <ul id="todo-list" data-woven="troopjs-todos/widget/list@12">
      <li class="active" data-index="0">
         <div class="view">
            <input class="toggle" type="checkbox" />
            <label>sdsd</label>
            <button class="destroy" />
         </div>
         <input class="edit" />
      </li>
   </ul>
</section>
双击后

<section id="main" data-woven="troopjs-todos/widget/display@6" style="display: block;">
   <input id="toggle-all" type="checkbox" data-woven="troopjs-todos/widget/mark@8" />
   <label for="toggle-all">Mark all as complete</label>
   <ul id="todo-list" data-woven="troopjs-todos/widget/list@12">
      <li class="active editing" data-index="0">
         <div class="view">
            <input class="edit" />
      </li>
   </ul>
</section>

0 个答案:

没有答案