NLP Page Objects Creation and Usage

Functionize allows you to create reusable elements, or Page Objects, so you don’t have to write out the same steps again and again. Write the steps for a login (or a similar repeated task) once and then use that same set of steps in hundreds of test cases, by simply stating in the test plan “Use page object ‘login’“.

In Functionize, we have two ways to create page objects.  You can create it as a standalone as if it were its own test and you can create it on the fly while writing the steps of your test case. This process will look familiar as page objects are created just like standard steps in a test case. See also Create a New Test Case for further information.  

Create a Standalone Page Object

  1. Click on the Create New Test button and add details for the Page Object.
  2. Click Next.
  3. On the Test Steps tab , Click  to add test steps.
  4. 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.
  5. Then set the <name> of the element in quotes.  
  6. Click   to add all repeatable steps within the page object.
  7. Type End Page Object (or select End Page Object from the keyword dropdown menu).  This notates the end of the page object being created.
  8. Set the <name> of the element in quotes.
  9. Click Submit.

Create a Page Object During Test Case Creation

You can also make a Page Object while you create your test case. This functions the same as a standalone page object, but is initially created within the steps of your existing test case. 

  1. On the Test Steps tab, click  to add test steps.
  2. 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.
  3. Then set the <name> of the element in quotes.  
  4. Click   to add all repeatable steps within the page object.
  5. Type End Page Object (or select End Page Object from the keyword dropdown menu).  This notates the end of the page object being created.
  6. Set the <name> of the element in quotes.
  7. Continue writing your test steps as normal for the 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 also: 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.

See also Page Objects to learn more about what they are and how to use them.

 

Learn more about Page Objects in this webinar