Relevant for: GUI actions, scripted GUI components, and function libraries
UFT provides automatic code completion features, to facilitate coding in the Editor. This includes some basic, static code snippets that you can insert automatically into your document, as well as templates that you can use to insert additional code snippets by typing specific keywords.
For example, if you enter the letters if at the beginning of an empty line in a GUI action, followed by a SPACE, UFT automatically enters:
If True Then End If
The word True is highlighted, reminding you to replace it with the relevant condition.
You can also modify the templates provided, or build your own customized templates as needed, and define the keywords used to invoke the use of each template.
For example, you might repeat a complicated If...Then statement many times your document. You can use an existing template for the If...Then statement to create your own customized template with your more complicated code. You can also create templates from scratch, such as a comment block template, which might include information such as programmer identification, date added, or other details you want included in all comments.
Code templates are defined in the Code Templates Pane, and are supported for the following file types, used for actions and function libraries:
For details, see Use code snippets and templates.
If you enter two characters that are the initial characters of multiple VBScript keywords, a drop-down menu appears with all of the relevant keywords, and you can select the one you want. For example, if you enter the letters pr and then enter a space, the drop-down menu is displayed, containing the keywords preserve, private, and property. You can then select a keyword from the list and press ENTER to insert it into your script.