Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Using Selenium how to delete single characters from a textbox using Selenium?

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


share|improve this question
up vote 5 down vote accepted

If you are using Java, try this to delete one character:

share|improve this answer
Thanks a lot. But what this "\u0008" is? ASCII value of backspace is 0x08 – smriti Jun 24 '11 at 12:31
"\u0008" is Unicode for the backspace character. The sendKeys method takes a CharacterSequence as input. "\u0008" is a CharacterSequence; 0x08 is an integer instead of a CharacterSequence. Moreover, you cannot use 0x notation to encode characters within a Java string. – user246 Jun 24 '11 at 13:07
Thanks a lot @user246 – smriti Jun 27 '11 at 8:22

While using the ASCII valid (\u008) is valid, there are already defines for this which makes your code more readable, as such:


For a list of the key names, there's some official documentation.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.