9. Working with Function Libraries
Function Library is a reusable component which can be used multiple times across same or different Test Cases. These functions are user-actions which can be repetitive. You can reference input and output parameters corresponding to the function. This OpKey module is flexible, scalable and robust in nature i.e. function(s) made in this module can be further used among different Test Cases in the form of test steps.
For example: For a shopping portal web-application, four function libraries can be created. One Function library can be for logging into the portal, other for searching the product, third for buying a product and the last one for logging out of the portal. These function libraries can be used in different test cases individually.
Working with Function Library
After successfully login into OpKey Web, select the appropriate Project in which you want to create a Function Library File.
You will be navigated to the screen having as shown.
You can mark the “Don’t show me again” checkbox as checked if you do not wish to view this notification again.
Click “End Tour” to proceed with the process of creating a Function Library file.
How to create a Function Library File?
Method 1
After clicking on “End Tour” , you may “Click to Create New Artifact“.Select Function Library.
The “Function Library” text will appear highlighted.
Click on the highlighted icon to create a New Function Library file. A Create Function Library window will get open as shown
The fields marked with * are mandatory. Enter the Name of the Function Library. You can also enter the Description. Click OK and start working on it.
Method 2
Go to Project Workspace > Select the root Folder > Click Create New file icon > Select Function Library.
A Function Library file will be created in the root Folder of the project Workspace.
You may rename the Function Library accordingly.
Method 3
Right click on root folder > select Create New > select ‘Function Library’.
A Function Library file will be created in the root Folder of the project Workspace.
There are two way of creating Function Library : By adding test steps and by recording.
Let’s first discuss about creating Function Library by adding test steps in the next article.
Open Function Library in New Tab :
Open in New Tab feature enables you to view added artifacts (FL, SR method, Mapped Objects, & Mapped DR) in a Function Library.
You can right click on added Service Repository Method and select Open in New Tab option to open added Function Library in new tab.
You can view mapped object with Function Library Test step in detail. Right click on mapped object and then click Open in New Tab.