Здравствуйте!
Пробую написать тест с использованием Coded UI, который запускает приложение и вводит логин в соответствующее поле:
var app = ApplicationUnderTest.Launch(@"C:\app.exe"); var loginEdit = new WinEdit(); loginEdit.SearchProperties.Add(WinEdit.PropertyNames.ControlName, "textEditLogin"); loginEdit.Text = "test005";
Получаю ошибку: System.NotSupportedException: SetProperty "Text" is not supported on control type: Window.
Меняю метод ввода текста:
Keyboard.SendKeys(loginEdit, "test005");
Получаю другую ошибку: Microsoft.VisualStudio.TestTools.UITest.Extension.PlaybackFailureException: (Failed to get the message for an exception of type Microsoft.VisualStudio.TestTools.UITest.Extension.PlaybackFailureException due to an exception.) ---> System.Runtime.InteropServices.COMException: HRESULT E_FAIL has been returned from a call to a COM component
В чем может быть проблема? Прикладываю скриншот со свойствами контрола.