简体   繁体   中英

Simulate the 'Enter' key pressed in silverlight UI through code?

如何通过自动测试用例中的C#代码模拟用户在Silverlight UI应用程序屏幕中按下的“ Enter”键?

if you are looking for a solution like UI Automation Framework then simply look up if the element has an Invoke Pattern among it's Automation patterns. The invocation usually does the exact same thing as clicking enter on a button or any other element.

if you are looking for a solution to simulate the actual press of the Enter Key, then you need to use Win32 API and use Keyboard.SendKeys("{ENTER}");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM