Page Actions
During the development of your test cases, you’ll come across multiple occasions where you are doing the same things – depending on your application under test – like; logging in, searching for products, navigation through menu’s, etc. It would be tedious to repeatedly write the same test steps over and over again, and worse, maintaining them, when something in your application changes. For this, JOSF offers the use of Page Actions.
A Page Action has 1) a name, 2) test steps just like groups and 3) input variables.
Input variables
While you use Page Actions to execute the same steps in different test cases, the used data may very well differ depending on your test case. For example, if you’re testing a web shop, it would be wise to create a “Search product” Page Action, with a variable product to search. This can be achieved by adding an input variable, named e.g. `product name`.
Adding input variables is done by pressing the `+ Add an input variable` button. There you can name your variable. Next, you’ll be able to use it in your test steps like regular variables with the correct syntax ${product name}
`.
A parameterized Page Action
Note how the input variable doesn’t have the variable syntax, but the use in the test step does require the variable syntax.
The use of a parameterized Page Action in a test step
Note how JOSF presents the input variable from the test step. When adding more than 1 input variable, JOSF will present the list of required input variables.