TestComplete Tutorial 11 - Different Ways to click on Button in Windows Desktop Applications
There are several ways to click a button in an application:
1. Click( ) or ClickButton( ) -These methods are used for single click on button.
Examples -
myButton.Click();
myButton.ClickButton();
2. Keystrokes -
- You can click a button by simulating keystrokes that represent an access key.
- An access key is an underlined symbol within the button caption.
- It permits a click of a button by pressing the ALT key in combination with the assigned access key.
Example -
If the underlined symbol is A, you should simulate pressing the ALT+A key combination.
myButton.Keys("~a");
3. Setting up the focus by Tab key -
- You can click a button by setting the focus to it (for example, by using the TAB key) and simulating the SPACE key press.
Sys.Keys("[Tab][Tab]");
Sys.Keys("[X32]");
Note: You can only click a button if it is enabled.
Comments
Post a Comment