Clear text from textarea with selenium (Java)

Clear text from textarea with selenium (Java)

As shown clearly in the script for this example, you simply need to use element.clear() where element is the text input.

WebElement query = driver.findElement(By.id("searchInput"));
query.sendKeys("the moon");
query.clear();

Leave a reply

Your email address will not be published. Required fields are marked*

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.