Therefore, these methods are preferable to SetText in certain cases.īelow is the information on how to use the described methods to simulate keystrokes from different kinds of tests. However, the key pressing methods also ensure that the appropriate keyboard events are raised in the tested application and the associated event handlers, if any, are executed. The Keys, KeyDown and KeyUp methods, in their turn, simulate actual key presses in the object, taking into account the Key pressing delay project setting. Note that the SetText action changes the object text programmatically, so, it may take less time to execute. These methods also have the Delay parameter. LLPlayer.KeyDown and LLPlayer.KeyUp - simulate low-level pressing and releasing the specified key. For complete information on the format of the string of keystrokes, see the method description.ĭesktop.KeyDown and Desktop.KeyUp - simulate pressing and releasing the specified key by its virtual code. This string can include alphanumeric characters as well as special key codes ( Ctrl, Alt, F1, Tab and others). All of these methods have one parameter - a string of keys to be typed. The difference between different Keys methods is that OnscreenObject.Keys types in the specified onscreen object, while Desktop.Keys and Sys.Keys type in the currently focused object. OnscreenObject.Keys, Sys.Keys and Desktop.Keys - send key presses to the desired object. You can simulate keyboard input from your tests by using the following methods:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |