1

I want to use double-click to edit (update, not totally remove) manually added text using Selenium & Selenide using the Page object model.

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

CSS before double-clicking the text field looks like

<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>

after double-click

<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>
JeffC
  • 22,180
  • 5
  • 32
  • 55
  • could you use clear() to change the value? – cocoa Oct 09 '15 at 15:08
  • no. I need to update old text without clearing. the cause problem that Ican not open active editing via doubleclick – user3568567 Oct 09 '15 at 15:13
  • does this solution work for you? http://stackoverflow.com/questions/21907007/selenium-webdriver-java-code-using-web-driver-for-double-click-a-record-in-a-gri – cocoa Oct 09 '15 at 15:15
  • no. The problem's that the class's changed from "Active" to "active editing" and I link DoubleClick a bit wrong – user3568567 Oct 09 '15 at 15:29

0 Answers0