Adding new actions to existing Keyword Tests

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.

Getting ready

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").

How to do it...

To add the operation for clicking on the button, it is necessary to perform the following steps:

  1. Select the Test Actions on the Operations toolbar.
  2. Double-click on the On-Screen Action element:
    How to do it...
  3. Drag-and-drop the sign of the target onto the button of CE and click on Next:
    How to do it...
  4. On the list of available methods, leave the ClickButton element selected by default, and click on the Finish button.
  5. In the result, we will have the created action appearing in our test:
    How to do it...

How it works...

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:

  • Test actions: These are operations used to work with screen elements, tests, objects search, and execution of code snippets
  • Logging: These are actions used to work with the log (output of messages, screenshots, and so on)
  • Web: This is a group of actions used to work with the browser
  • Checkpoints : These are used to create various checks in the tests
  • Statements: These are analogues of the for, while, if…then…else, try…catch loops, and statements
  • Miscellaneous: These are actions for other possibilities (working with the Indicator, insertion of a delay, and so on)

There's more...

Sometimes, 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:

There's more...

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.12.34