Why Hiptest will remove the ability to use ${variable} format in action word names?
  July 26, 2018

Since its creation, Hiptest relies on action words to ease the maintenance of your project and ensure that a consistent business terminology is used across all the scenarios. One of the greatest strength of the action words is the fact that they can have parameters, allowing a great reusability across multiple scenarios.

Use action word parameters

For example, here is the action word "a message should be displayed" that has one parameter named "messageText":

Hiptest action word page

You can call it with different values in the scenarios:

Hiptest action word calls

In this case, this action word is called three times with three different values.

Use inlined parameters

To improve the scenario readability, you can inline a parameter directly in the action word name. It is pretty easy, you just have to add "parameterName" in the action word name where you want see the parameter name. For example:

Hiptest action word with a inline parameter

In this case, the action word calls will be displayed like that:

Hiptest action word calls with inlined parameter

It greatly improves scenario readability.

Note that you can rename an action word directly from the scenario editor. Be careful, here you are editing the action word name and not the parameter value. That's why in the capture below you can see that the  "Coffee machine is ready" value disappears during the renaming:

Edit action word name from step editor

Use a datatable

https://youtu.be/ZB2Z2RN-Mw0

If the scenario uses a datatable, you can use the column name as a variable. You can call an action word with this value. To do so, you should use the format =variableName to specify that you want use a value of the column and not the "variableName" string.

Hiptest datatable

Hiptest action word call with column name as parameter value

 

Start Hiptest for free banner

 

Automate your scenarios

Of course, when Hiptest publisher generate tests in your favorite language, parameters are generated too. For example, in Java, you'll obtain these lines in the scenario:

actionwords.theMessageMessageTextShouldBeDisplayed(greetingMessage);

actionwords.theMessageMessageTextShouldBeDisplayed("Fill beans");

actionwords.theMessageMessageTextShouldBeDisplayed("Empty grounds");

And this code to define the action word:

public void theMessageMessageTextShouldBeDisplayed(String messageText) {}

 

Ok, fine but what is the connection with ${variable} format?

The format ${variable} has nothing to do with action word. In fact, in some cases, it is possible to use the action/result steps in a scenario. These steps are not recommended because they don't allow reusing and automating.

If you need to use a datatable column in a step, you should use the ${variable} format. For example:

Action result steps

Ok, so what is the problem?

The support team noticed that some users have been miss leaded and confused by the two notations and use the ${variable} format in action word names. In this case, that seems to work because tests are correctly instantiated with the datatable value but:

  • no parameters are created in the action word,
  • you cannot reuse the action word with other values,
  • automation is impossible.

Because of this, we decided to remove the interpretation of the ${variable} format in the action word names.

And what does it involve?

If you use action word parameters with the double quotes notations, you have nothing to do. But if you're using ${variable} format in the name of your action words, the tests will not interpret the datatable parameter anymore.

No, don't do that, my project will be broken!

Do not panic, you can fix your project easily. Just go the action words page and in the menu, select Fix action words parameters.Hiptest fix action word parameters menu

This feature will analyse your project and shows you the action words that are using the wrong notation:

Fix action word parameters modal

Just click on "Start refactoring".

Fix action words parameters done

That's it, you can close the modal and continue to use Hiptest!