Selenium: delete contents from a textbox

smriti picture smriti · Jun 23, 2011 · Viewed 14.1k times · Source

Through selenium. how to delete contents from textbox.

I have to delete the last 2 characters from text box using selenium command.

Ex.ABCD to AB.

Answer

rs79 picture rs79 · Jun 23, 2011

Try this -

selenium.type("text_box_object", "ABCD");
selenium.typeKeys("text_box_object", "\b");
selenium.typeKeys("text_box_object", "\b");