I have a TextBox declared in a Silverlight project with contents “123456” and then use the following code in a Coded UI test. First it searches and clicks the TextBox to set focus, and then tries to delete characters.
currencyPage.ClickEditByAutomationId("textBox");
Keyboard.SendKeys("{END}");
Keyboard.SendKeys("{BACKSPACE}");
Keyboard.SendKeys("{BACKSPACE}");
Keyboard.SendKeys("{BACKSPACE}");
Keyboard.SendKeys("{BACKSPACE}");
Keyboard.SendKeys("{BACKSPACE}");
This is the resulting text in my TextBox: 123456BBBBB
What am I doing wrong? XAML of the textbox: