UI Automation... SendKeys not working

3 posts, 0 answers
  1. Stefan
    Stefan avatar
    7 posts
    Member since:
    Sep 2018

    Posted 14 Jun Link to this post

    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. Stefan
    Stefan avatar
    7 posts
    Member since:
    Sep 2018

    Posted 14 Jun in reply to Stefan Link to this post

    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 ?
  3. Vladimir Stoyanov
    Admin
    Vladimir Stoyanov avatar
    503 posts

    Posted 19 Jun Link to this post

    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.
Back to Top