clear text field using DELETE or BACK SPACE key in webdriver
<p>I am trying to clear a text field using this action:</p>

<pre><code>emailField.sendKeys("gmail.com");
emailField.sendKeys(Keys.CONTROL,"a",Keys.DELETE);
</code></pre>

<p>In above code, the last line only selects the text, does not delete it, but if I separate the actions it works.</p>

<pre><code>emailField.sendKeys(Keys.CONTROL,"a");
emailField.sendKeys(Keys.DELETE);
</code></pre>