seleniumautomationselenium-rc

how to delete default values in text field using selenium?


I want to delete a default value of a textbox to enter the new value, but I am not getting how to do that.

I was thinking to use CTRL+a and then Delete but I'm not sure how to do this.

I even used WebDriver's command driver.findElement("locator").clear();.


Solution

  • If you're looking for a solution from Selenium RC, you can use simply

    // assuming 'selenium' is a healthy Selenium instance
    selenium.type("someLocator", "");