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.
             Example - 

                            Sys.Keys("[Tab][Tab]");

                            Sys.Keys("[X32]"); 


NoteYou can only click a button if it is enabled.

Comments

Popular posts from this blog

TestComplete Tutorial 9 - Mouse Actions and Mouse Wheel Events

TestComplete Tutorial 19 - Adding Objects to the Name Mapping Repository

TestComplete Tutorial 14 - Object identification criteria in Name Mapping