Using Selenium how to delete single characters from a textbox using Selenium?
I have to delete the last 2 characters from text box.
Ex: ABCD to AB
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It only takes a minute to sign up.
Sign up to join this communityUsing Selenium how to delete single characters from a textbox using Selenium?
I have to delete the last 2 characters from text box.
Ex: ABCD to AB
If you are using Java, try this to delete one character:
element.sendKeys("\u0008");
While using the ASCII valid (\u008) is valid, there are already defines for this which makes your code more readable, as such:
element.sendKeys(Keys.BACK_SPACE);
For a list of the key names, there's some official documentation.