title: How to clear the field of web element - Groovy
body: <p>According to chapter 4.10 of this <a href="http://www.gebish.org/manual/0.10.0/navigator.html" rel="nofollow noreferrer">documentation</a>:</p>
  
  <p>To clear the field of webElement I can do:</p>
  
  <pre><code>webElement &lt;&lt; Keys.chord(Keys.CONTROL, "a", Keys.BACK_SPACE)
  </code></pre>
  
  <p>But it doesn't look clean for me.
  Is there a way to write a method named "clear" which could be called on a webElement and invokation of this method would look like this?</p>
  
  <pre><code>webElement.clear()
  </code></pre>
  
  <p>How this method would look then?</p>
  
  <p>I managed just to do something like this:</p>
  
  <pre><code>def clear() {
      return Keys.chord(Keys.CONTROL, "a", Keys.BACK_SPACE)
  }
  
  webElement &lt;&lt; clear()
  </code></pre>
  
  <p>Do I have other possibilities or approaches to this problem to be able to call a method on element to clear it?</p>
  
  <p>I can not use the selenium method clear() cause the spark framework which supports application which I test forbid this method.</p>