1.

How can I use Selenium WebDriver to clear the text in a text box?

Answer»

The above TASK can be done using the clear() function as shown below:

WebDriver driver = NEW FirefoxDriver();driver.get("https://www.youtube.com");driver.findElement(By.xpath("xpath_of_element1")).sendKeys("Interview BIT");driver.findElement(By.xpath("xpath_of_element1")).clear();


Discussion

No Comment Found