In this recipe we will deal with the manual addition of actions to the Keyword Tests without resorting to the means of recording scripts. As an example, we will consider an operation of a mouse-click on the CE button.
Create a new empty Keyword Test (right-click on the Keyword Tests element, Add | New Item) and launch the Calculator Plus application ("C:Program Files (x86)Microsoft Calculator PlusCalcPlus.exe"
).
To add the operation for clicking on the button, it is necessary to perform the following steps:
It is not only possible to record the actions in the Keyword Tests through the recording means—they can be created manually as well. Meanwhile, we need to signify a specific object for each action that we are handling: including the action we undertake and their parameters (if they are necessary for the action in view).
In the Operations list, there are several available operations:
for
, while
, if…then…else
, try…catch
loops, and statementsSometimes, it is easier to add new actions to test by recording them into the existing test, other than manually creating those. To this end, we need to click on the Append to Test button on the Keyword Test toolbar and record the actions:
The actions can be easily reordered by simply dragging them to a new location, yet any keyword test can be run from any step by right-clicking on the step and selecting Run from the selected operation menu item.