"CALL" Command
Description: This command is used to call a function. Functions allow reusing several steps grouped together, either in test cases or other functions. Once we create a function we can use this command to call it.
Usage Scenario: For example, suppose we want to reuse the login process in several test cases that need it. The login process has 4 steps:
1- Click login_link_locator_artifact
2- Fill username_textbox_locator_artifcat value
3- Fill password_textbox_locator_artifact value
4- Click login_button_locator_artifact
Procedure: Create the four steps, define locators for them and group them into a single function with title "subject7_reference_login". Then use Call command and select this function in your test case. Your steps should look like this:
Step view:
Expanded function view:
See the reference Test Library path: subject7_samples/subject7_basic_suite/subject7_website_login_logout
The following video demonstrates how the functions “subject7_reference_login” and “subject7_reference_logout” are called and executed as part of “subject7_website_login_logout” test case in “subject7_samples” folder: