Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

How to clear the text in the text box using Selenium WebDriver?

Category: Selenium WebDriver

By using clear() method
WebDriver driver = new FirefoxDriver();
driver.get(“https://www.gmail.com”);
driver.findElement(By.xpath(“xpath_of_element1”)).sendKeys(“Software Testing Material Website”);
driver.findElement(By.xpath(“xpath_of_element1”)).clear();

Leave a Reply

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