logo

Maintaining and modifying the tests

Modify value

Harmony generated the test step, however, sometimes you need to modify or improve it. When you execute a test manually, a result can be wrong. You can modify the value to be correct, by which the test will fail according to our intention.
Image without caption
First, click on the faulty value, the modify it, finally press enter or the OK icon:
Image without caption

Modifying identical meaningless selector name

Sometimes you want to modify the abstract selector name. If no special attribute is attached to a UI object, Harmony gives a name for each CSS selector. It’s taken from the DOM and can be meaningless such as ‘svg’ or ‘INPUT’.
Image without caption
Here we want to modify ‘INPUT’ to ‘original password’. Clicking on the ‘rename INPUT → original password’, all the ‘INPUT’ selector names will be changed in any action or response:
Image without caption
In the sector window, the name is also changed while the original CSS selector remains.

Modify a single selector name

Adding new steps, modifying steps

Sometimes you should add or replace a test step. It can be done while you execute a test case using the runner. The most probable case is when a test fails. The execution stops and you can re-execute the faulty step again and then delete the faulty one.
Here the selector became wrong:
Image without caption
Hoovering the mouse on the right side of the grey area a ‘+’ icon appears on the top, on the bottom, and between the low-level steps. In this figure the icon appears between the first and the second steps. Pressing it, you can add a new step:
Image without caption
Then, you can delete the faulty step:
Image without caption
Finally, press Done.

Modifying the CSS selectors

Harmony generates good selectors, but sometimes the id or the special attribute ‘data-’ is not unique. In this case, you should modify the selector. If the special attribute is not unique, then Google Chrome Inspect gives an appropriate selector, if the id isn’t unique you should make it by hand or using other selector generators. To modify the selector, let’s select ‘Selectors’ menu item:
Image without caption
Then modify the selector:
Image without caption
then press Enter or the OK icon.

Fixing a wrong selector

This is the problem that happens many times and coded test automation frequently fails. In Harmony, you should change the selector at a single place with one click. In Harmony a single click is enough to fix the selector.
  1. select the wrong selector name (three clicks on it)
  1. search for it (Ctrl + f)
  1. open the selector window
  1. delete the wrong selector -
Image without caption
  1. Harmony shows that no selector for the selector name exists
Image without caption
  1. re-execute the test case
  1. when the execution stops at the selector name having no selector, you can click on the related UI object:
Image without caption
and a new selector is created (the red outline disappears)
Image without caption
If there are quite similar selectors, and the first becomes wrong, you can assume that the others will be also wrong. In this case, you can easily delete all these selectors as they are in alphabetic order, i.e. one beneath the other.
Image without caption