Building & Maintaining the Test Instructions within a Test Script
- Purpose of the Test Instructions Grid within a Test Script
- Understanding the 'Instructions Grid' and the various features that the grid's 'Header' offers
- Understanding the difference between the 'Basic Test Instruction Editor' and the 'Premium Test Instruction Editor'
- Accessing the Command Reference for a command in Worksoft SaaS Knowledge Base
- Key actions that you can perform within the test instructions grid
- Adding a Test Instruction
- Editing a Test Instruction
- Deleting a Instruction
- Commenting out a test instruction so that it does not execute when an automated test runs
- Adding verbose comments below a group of test instruction to capture key notes about what the group of comments do
- Changing the order of Test Instructions using Drag-and-Drop
- Copy/Pasting Test Instructions within the Script using keyboard shortcuts
- Expanding and Collapsing of a 'Grouping' of loop constructs (like while, foreach, etc.,) within the test script
- Expanding and Collapsing of a 'Grouping' of block commands (like dbBlock, if, else, wsBlock, etc.,)
- Adding & Managing the Locators or Content in the 'Target' field
- Encrypting/Decrypting contents of the 'Target' & 'Value' fields
- Viewing the contents of the 'Target' or 'Value' in clear text temporarily
- Entering User Notes for a Test Instruction
- Parameterizing (Binding) the 'Target' field to an Attribute of the Data Definition for data-driven testing
- Parameterizing (Binding) the 'Value' field to an Attribute of the Data Definition for data-driven testing
- Parameterizing the Value for 'File' binding
- Inserting (embedding) User-defined Variable(s) into the 'Target' or 'Value' fields
- Inserting (embedding) System Variable(s) into the 'Target' or 'Value' fields
- Inserting (embedding) Data Definition name into the 'Target' field for the command 'ddCreateDataset'
- Searching for (finding) test scripts that contain specific commands, target and value field content on the test scripts' home screen
- Searching for (finding) instructions that contain specific commands, target and value field content on the test script
Purpose of the Test Instructions Grid within a Test Script:
The main purpose of the test instructions grid is to hold all the test instructions within your test script. All the information that is outside the test instructions grid is meta-data if you will about the script or the configuration of the test script.Understanding the 'Instructions Grid' and the various features that the grid's 'Header' offers:
The header of the test instruction grid has several handy little powerful features. You should spend some time to become aware of these features:
It contains several icons that will allow you to perform key actions like:
- adding, editing, deleting a test instruction
- commenting in/out a test instruction so that it does not execute when the automated test executes
- adding verbose descriptions above a grouping of test instructions to describe what that group of instructions do
Turning 'ON'/'OFF' the Tooltips on the Actions column icons:
In the header of the 'Actions' column, there is a little blue annotation icon that you can use to shut off the tooltips that show on each of the actions icons within in each of the test instructions rows in the grid. This icon acts like a toggle. If you click it once, the tooltips are enabled (turned on). If you click it again, the tooltips are disabled (turned off). o
Some users find the tooltips on every row of the test instructions grid annoying and as a productivity issue. This feature allows you to turn off the tooltips
This column contains a unique identifier that is Worksoft SaaS system generated that shows the sequence number of test instruction within the test script. The last number in this column tells you how many instructions the script contains.
You cannot edit the value of the instruction sequence number because it is system generated and informational purposes only.
When you execute tests that contain a script and failures occur within specific instructions, you will be able to easily trace back to the specific test instructions in a script by using this #.
The 'Command' column:
The 'Command' column contains the specific commands that are used within the script to implement the logic of your manual test case. The commands within the test script are chosen from the command repository that Worksoft SaaS supports. Refer to Worksoft SaaS Command Reference for a complete list of categories of commands and the list of commands within each category.
The 'Target' and 'Value' columns:
The 'Target' column typically contains the target on which the command works and the 'Value' column typically contains the values fed into the command as input.
The 'Target' will contain the locators to identify that the user interface elements on the web page or the native/hybrid app for commands that interact with your AUT. For other commands that don't interact with the app, you can generally treat the contents you pass into the 'target' and 'value' fields as inputs to the command. Sometimes, the output of the command will be written into a variable or a dataset you pass into the 'value' field of the command.
Hiding/Unhiding bindings and encryption indicator icons in the 'Target' & 'Value' columns:
Worksoft SaaS allows you to encrypt sensitive content (like passwords, social security numbers, etc) within the target and value fields of the test instructions of the test script. When you mark a target or value as 'encrypted', by default, the test instruction grid shows a visual indicator (a lock) within the 'Target' and 'Value' columns if there is at least one instruction within the test script that has its target and/or value encrypted.
In addition, Worksoft SaaS also allows you to bind the 'target' and/or 'value' fields of test instructions within a script to 'attributes' of a data-definition, to user-defined variable(s), to system variables. In the 'Target' and 'Value' columns of the test instruction grid three visual indicators exist, all of which look like a clip with a alphabet as superscript. The superscript of 'A' stands for 'Attribute', 'U' for User-defined Variable, 'S' for 'System Variable', and 'F' for 'Files' (for browser upload to your AUT from within your automated tests).
The color of the clip in these icons will either appear gray or blue. If it is grey, it means that the target or value is not bound to 'A' , 'U', 'S' OR 'F'. If it is blue it means the target or value is bound.
While the appearance of the four graphical icons is useful for you, when your focus is not the significance or cues from these icons but the content of the target or value of test instructions, it will make sense for you to temporarily get the graphical icons to not appear on the screen. There is a little black right-facing arrow in the border between the 'command' and 'target' columns, and between the 'target' and 'value' columns. When you click on this icon, Worksoft SaaS will temporarily hide the bindings indicator icons and the encrypted content indicator icon within all rows of the test instruction grid so that you can see more of the content of the target and values.
If you click on the left-facing arrow indicator, all the indicators will reappear. By default, the indicators are shown in both target and value columns.
Viewing encrypted data in clear text temporarily for 'Target' and 'Value' of Test Instructions:
Worksoft SaaS allows you to encrypt sensitive content (like passwords, social security numbers, etc) within the target and value fields of the test instructions of the test script. When you mark a target or value as 'encrypted', by default, the test instruction grid only shows encrypted (and not clear text) content.
If you want to temporarily view the contents of the encrypted data in clear text format, you don't have to open each instruction that has the target and/or the value fields encrypted and turn off the encryption. Instead, you can very simply click on the little blue icon that has an inclined line going through that appears to the right of the 'target' column and/or the 'value' column header. That will show the encrypted content in all those instructions that have encrypted targets and/or values. That action of yours will make the inclined blue line within the eye to go away. If you click on that icon, the encrypted values will show again within the test instructions grid. Please note that after enabling the display of clear text values for encrypted content in the target and/or value columns, if you move out of the test script screen and come back into the same script, the default view will display the encrypted content again.
Resizing the width of the Command and Target columns:
The little blue marker icon that appears right above the column separation between the 'Command' header and the 'Target' can be used to reduce the width of the command column so that more width is temporarily allocated to the 'Target' column in the grid.
This feature, when used, will allow you to see more content in the 'target' column within the grid. (Note: In the near future, we will also support the same feature to adjust the width of the 'Value' column and 'Target' columns.)
Understanding the difference between the 'Basic Test Instruction Editor' and the 'Premium Test Instruction Editor'
As you aware by now, a test script is essentially a collection of test instructions. The core logic of your automated tests resides within the test instructions.
To allow you to easily create and edit test instruction, Worksoft SaaS offers two editors, each with its own advantages:
- A 'Basic Editor' allows you to enter content for the target and value fields of your test instruction into text input fields or special purpose drop-downs within the test instruction pane that appears inline within the test instructions grid. When the length of the content is not too high, you may like the basic editor view
- A 'Premium Editor' allows you to enter the content of target or value fields using large text areas which is easier to the eye when the length of the content is high. There are other advantages as well. At a high level, this editor allows you to configure less number of fields that make up a test instruction (all of which are configurable within the basic instruction editor).
The Basic Test Instruction Editor:
When you are in the the edit mode (or the view mode) of a test script, you can open the basic test instruction editor (or viewer), by double clicking anywhere in the test instruction that you are interested in editing.
- Specify a 'command' for your test instruction by choosing from one of the many commands that are supported within Worksoft SaaS. Refer to Worksoft SaaS Command Reference for a complete list of categories of commands and the list of commands within each category.
- Enter into the 'Target' field the list of locators to identify the user interface elements within your AUT for commands that interact with your AUT. For other commands that don't interact with your AUT, you will be entering a single input.
- 'Element' field shows up for commands that interact with AUT. This is user editable field so if you want to make any modifications, you will be able to do so. The icon shown in the field has two flavours: grey & blue. You see grey icon when this field is not used in execution results page and when you do a mouseover on the icon, text can be seen stating the same.
You would need to toggle the setting in 'User Settings' to have this value showing up in execution results instead of the locator value from the target field.
- The screenshot below illustrates how the UI Element Name will display on the Test Execution Results screen (both for local & cloud executions)
- Select element to capture its locators
- Verify validity of locators and follow that up with using magic wand
- Label - labels are tags used in HTML to explain the use of an element
- Display name of the AUT element - like text on buttons, reference text for anchor tag or place holder for input types
- ARIA tags (title < aria-label < aria-labelledby < alt) - Text used by various text readers and most of the applications these days are using these tags to comply with American Disabilities Accessibility (ADA) Web Accessibility Standards & Requirements
- As a last resort, text within the element if none of the above are available
- Enter into the 'Value' field a single input that is expected from the command.
- You can also optional add your own note on what the test instruction is doing in the context of your manual test case OR why you configured the test instruction as you did or anything of importance for you.
- In addition to the above-mentioned core fields, you can also parameterize the target or value fields by binding the target or value to attributes of a data definition, to user-defined variables, system variables, data definition names, or files.
- By clicking on the set-of-books icon that appears to the right of the 'command' drop-down, you can launch/access the Worksoft SaaS Knowledge Base that will open in a new browser tab.
- You can mark the 'target' and/or 'value' fields for encryption by clicking on the blue lock icon that appears to the right of the those two input fields.
- If you marked the 'target' and/or 'value' fields for encryption, and you want to temporarily see in clear text the encrypted content of those fields, you can click on the blue eye icon that has a inclined line inside. To see the encrypted content again, you can click on the blue eye icon.
- When the command is one that interacts with your AUT and if the target has more than one locator to identify the user interface elements, you can expand the drop-down for the 'target' field, and within that control add new locators, edit existing locators, delete locators, or even drag-n-drop the locators to adjust the sequence of execution of those locators. You can also copy to clipboard the locator, one at a time, and paste the copied values to create additional locators for the same instruction or other instructions.
- Within both the 'target' and 'value' text input fields, if you want to, launch the 'Premium Test Instruction Editor' (or viewer if you are in the view mode of the test script).
When recording new test instructions within a new or an existing test script, you don't have to do anything additional for this information to be captured by QaSCRIBE and for that information to be saved as part of your Test Script. If you editing an older test script that has no AUT Labels captured, you can use one of the below features to record AUT Labels.
The 'Premium Test Instructions Editor' (or viewer if you are in the 'view' mode of the test script) can be used to more conveniently view/edit the contents of the target or the value fields of a test instruction.
- If you marked the 'target' and/or 'value' fields for encryption, and you want to temporarily see in clear text the encrypted content of those fields, you can click on the blue eye icon that has a inclined line inside. To see the encrypted content again, you can click on the blue eye icon.
- When the command is one that interacts with your AUT and if the target has more than one locator to identify the user interface elements, you can use the left and right navigator arrows to easily navigate between all the locators of the target.
- You will be able to delete the locators one at a time.
- You can also copy to clipboard the locator, one at a time, and paste the copied value to create additional locators for the same instruction or other instructions.
- You can also embed or insert into the target or value fields dynamic variables that involve user-defined variable(s), system variable(s), data definition name.
Key actions that you can perform within the test instructions grid
There are numerous actions that are available for you to use to easily build and maintain test instructions within a test script.
Adding a Test Instruction
Deleting a Instruction
Commenting out a test instruction so that it does not execute when an automated test runs
Adding verbose comments above/below a group of test instruction to capture key info about what the group of instructions do
Changing the order of Test Instructions using Drag-and-Drop
Copy/Pasting Test Instructions within the Script using keyboard shortcuts
Expanding and Collapsing of a 'Grouping' of loop constructs (like while, foreach, etc.,) within the test script
Expanding and Collapsing of a 'Grouping' of block commands (like dbBlock, if, else, wsBlock, etc.,)
Adding & Maintaining Locators/Content in the Target field:
Encrypting/Decrypting contents of the 'Target' & 'Value' fields of a Test Instruction:
Viewing the contents of the 'Target' or 'Value' in clear text temporarily:
Entering User Notes for a Test Instruction
Parameterizing (Binding) the 'Target' field to an Attribute of the Data Definition for data-driven testing:
Parameterizing (Binding) the 'Value' field to an Attribute of the Data Definition for data-driven testing:
Parameterizing the Value for 'File' binding:
Inserting (embedding) User-defined Variable(s) into the 'Target' or 'Value' fields:
Inserting (embedding) System Variable(s) into the 'Target' or 'Value' fields:
Inserting Data Definition name into the 'Value' field for the command 'ddCreateDataset':
The Test Scripts home screen allows you to search for or filter the test scripts listed within the 'My Favorites' view or the 'Script Library' view based on the test instruction containing specific commands, target or value field content. To learn more, click here.