This is a migrated thread and some comments may be shown as answers.

UI Automation... SendKeys not working

2 Answers 209 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Stefan
Top achievements
Rank 1
Stefan asked on 14 Jun 2019, 11:16 AM

Hi,

I create UI tests for our WPF Desktop App.
For this I use the WinAppDriver from Microsoft.
Everything works fine, excepting "SendKeys" to AutoCompleteBox.

 

m_session.FindElementByAccessibilityId("AutoComlpleteBoxID").Click();   // Works ... I see the input cursor inside the box

m_session.FindElementByAccessibilityId("AutoComlpleteBoxID").SendKeys("12345"); // Works not !

Exception:
An unknown error occurred in the remote end while processing the command.

Any Idea why it happens.
With a standard WPF textbox it works.

Regards
Stefan

2 Answers, 1 is accepted

Sort by
0
Stefan
Top achievements
Rank 1
answered on 14 Jun 2019, 11:27 AM
Maybe the problem is that the property for the text is not text... it's SearchText.
But there must be  a way to use it, or not ?
0
Vladimir Stoyanov
Telerik team
answered on 19 Jun 2019, 10:50 AM
Hello Stefan,

Thank you for the provided code snippet. 

In order to achieve what you are going for, you can find the RadWatermarkTextBox inside the RadAutoCompleteBox and invoke the SendKeys method on it. Here is some sample code:
var watermark= session.FindElementByAccessibilityId("AutoComlpleteBoxID").FindElementByClassName("RadWatermarkTextBox");
watermark.Click();
watermark.SendKeys("12345");

Can you give this a try on your end and let me know how if goes?

I am looking forward to your reply.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
AutoCompleteBox
Asked by
Stefan
Top achievements
Rank 1
Answers by
Stefan
Top achievements
Rank 1
Vladimir Stoyanov
Telerik team
Share this question
or