Customizing script templates
You can customize the default script templates that HCL OneTest™ UI uses to format and provide basic information when you create a script.
To customize a script template, use the HCL OneTest™ UI. Script Templates Property Page. In HCL OneTest™ UI, Eclipse Integration, you can also use the Java™ editor, which provides simple formatting of the template and help with the Java™ syntax. In HCL OneTest™ UI, Microsoft Visual Studio .NET Integration, you can use the Code editor.
Several types of script templates are available:
Script: Header of the file -- Customizes the layout of new script files.
Script: Comment for Test Object -- Customizes a test object comment line inserted into a script by the recorder.
Script: Comment for top level Test Object -- Customizes a top-level test object comment line inserted into a script by the recorder.
Script: HTML Test Object Name -- Customizes the names of HTML test objects in a script.
Script: Java™ Test Object Name -- Customizes the names of Java™ test objects in a script.
Script: .Net Test Object Name -- In HCL OneTest™ UI, Eclipse Integration, customizes the names of .NET test objects in a script.
Script: Windows® Test Object Name -- In HCL OneTest™ UI, Microsoft Visual Studio .NET Integration, customizes the names of Windows® test objects in a script.
VP: Verification Point Default Name -- Customizes the names of verification points that HCL OneTest™ UI generates by default in the Verification Point and Action Wizard.
Script Helper: Header of the file -- Customizes the layout of a helper class when auto-generated.
Script Helper: Test Object Method -- Customizes the layout of test object methods in the helper class.
Script Helper: Verification Point Method -- Customizes the layout of verification point methods in the helper class.
Script Helper Superclass -- -- Customizes the layout of the script helper superclass.
You use placeholders in the script template to include information in each script that you generate. There are five types of placeholders:
- Default placeholders -- Available for any of the script templates.
- Script placeholders -- Use in the following types of script templates:
- Script: Header of the file
- Script Helper: Header of the file
- Script Helper: Test Object Method
- Script Helper: Verification Point Method
- VP placeholders-- Use in the VP: Verification Point Default Name script template.
- Object Map Property placeholders -- Use in the following types
of script templates:
- Script: Comment for Test Object
- Script: Comment for top level Test Object
- Script: HTML Test Object Name
- Script: Java™ Test Object Name
- Script: .Net Test Object Name
- Script: Windows® Test Object Name
- Script Helper Super Class placeholders-- Use in the Script Helper Parent: Header of the file template.
The following table lists the placeholders available for each script template:
Script Template | Placeholder |
---|---|
Script: Header of the file | Default Placeholders and Script Placeholders |
Script: Comment for Test Object | Default Placeholders and Object Map Property Placeholders |
Script: Comment for top level Test Object | Default Placeholders and Object Map Property Placeholders |
Script: HTML Test Object Name | Default Placeholders and Object Map Property Placeholders |
Script: .Net Test Object Name (HCL OneTest™ UI, Eclipse Integration only) | Default Placeholders and Object Map Property Placeholders |
Script: .Net and Windows® Test Object Name (HCL OneTest™ UI, Microsoft Visual Studio .NET Integration only) | Default Placeholders and Object Map Property Placeholders |
Script: Java™ Test Object Name | Default Placeholders and Object Map Property Placeholders |
VP: Verification Point Default Name | Default Placeholders, VP Placeholders, and Test Object Placeholders |
Script Helper: Header of the file | Default Placeholders and Script Placeholders |
Script Helper: Test Object Method | Default Placeholders and Script Placeholders |
Script Helper: Verification Point Method | Default Placeholders and Script Placeholders |
Script Helper Parent: Header of the File (HCL OneTest™ UI, Eclipse Integration only) | Default Placeholders and Script Helper Super Class Placeholders |
To omit associated punctuation for any null properties, enclose the placeholder in pairs of carets (^). HCL OneTest™ UI removes everything between the carets if the placeholder does not resolve to a valid value. For example, the underscore separator is removed if the #name property is null:
^%map:#name%_^%map:#role%