Functionize allows a user to create reusable elements, or ‘Page Objects’, so that they don’t have to write out the same steps again and again. Imagine for a moment, writing the steps for a login once and then using that same set of steps in hundreds of test cases, by simply stating in the test plan “Use page object ‘login’“. It speeds up the creation process greatly. In Functionize, there are two ways to create page objects. One is to create a standalone page object that can be used as part of any test case within that project and the other is to create the page object while writing a test case. Neither way offers an advantage over the other. In this tutorial, learn how to create and use page objects/reusable elements. They are created in exactly the same way as steps in a test case. Create a New Test Case for further information.
Create a Standalone Page Object
When creating a standalone Page Object, click on button and add details for the Page Object. Then click Next. *Please note this is not considered or counted as an actual test case.
- On the Test Steps tab , Click
to add test steps.
- Type Create Page Object (or select Create Page Object from the keyword dropdown menu). This notates the start of a page object to be created.
- Then set the <name> of the element in quotes.
- Click
to add all repeatable steps within the page object.
- Type End Page Object (or select End Page Object from the keyword dropdown menu). This notates the end of the page object being created.
- Set the <name> of the element in quotes.
- Here is an example of the creation of a page object:
8. Click Submit. This creates a standalone page object.
Create a Page Object/Reusable Element as Part of a Test Case During Test Case Creation
When creating a page object as part of a test case, simply include the above steps for creating a page object only the steps will exist within the rest of the test steps being written within a test case.
- On the Test Steps tab, click
to add test steps.
- Type Create Page Object (or select Create Page Object from the keyword dropdown menu). This notates the start of a page object to be created.
- Then set the <name> of the element in quotes.
- Click
to add all repeatable steps within the page object.
- Type End Page Object (or select End Page Object from the keyword dropdown menu). This notates the end of the page object being created.
- Set the <name> of the element in quotes.
- Continue writing additional test steps for the test case.
- Here is an example of the creation of a page object as part of a test case:
Using a Page Object/Reusable Element
Once a page object is created in one of the two ways described above, it is saved and ready to use in any test case. During the test step writing process, type the keyword Use Page Object. In the example above, create a step called Use Page Object "login".
Editing a Page Object
Editing a page object is done within the test case steps. Simply edit the test case steps for the page object. See how to Edit a Test Case.
Best Practices for Page Objects
Below are keywords currently used for Page Objects. These should be used when writing test cases for NLP processing.
Keyword | Use of Keyword | Example of Keyword Usage |
Create Page Object | This is to notate the start of a page object to be created and used in this test case. |
Step 1: Create Page Object <name> Step 2: Click login and enter <email> Step 3: Enter <password> Step 4: Click submit End Page Object |
End Page Object | To notate the end of a page object that is being created. |
Step 1: Create Page Object <name> Step 2: Click login and enter <email> Step 3: Enter <password> Step 4: Click submit End Page Object |
Use Page Object | This is used for existing or previously created page objects | “Use Page Object login w/admin” |
Sample .csv files for creating Page Objects
Best Practice: Add Mobil to cart - use predefined page object.csv *This example shows the use of a preexisting Page Object that was predefined as it's own separate test case.
Best Practice: Define Login and Logout Page Objects.csv *This example shows 2-page objects being created within a single test case.
Best Practice: Add Mobil to cart AND define Page Object INLINE.csv *This example shows a page object being defined inline within the context of the test case.
Click Page Objects to learn more about what they are and how to use them.
Learn more about Page Objects in this webinar.