Creating and using a Reusable component in Test Case




Reusable Components are user actions that can be reused across various test cases, saving time on repetitive tasks. These components support input and output parameters and can also be merged with other reusable components.

For instance, in a shopping e-commerce site, you can create four reusable components: one for logging in, another for product search, a third for purchasing, and the last for logging out. These components can be utilized individually across various test cases.



Working with Reusable Components


1. On the left panel click Automate. Navigate to the Reusable Component icon.


2. Click on the Create Reusable Component icon and select the Automated Reusable Component.



3. A new page opens, where you need to enter the details of the name of the reusable component, set the priority level, choose an assignee, add a description, and click on Create. 


4. Your reusable component is ready. Now, click on the Record button to add steps to it.


5. The recorder is available for web applications, different ERPs, mobile, and desktop applications. You need to select the recorder, enter your test URL, and click the Start Recording button.


6. The recorder window opens with your URL in a browser window. Enter the login credentials and sign in. Once the steps are recorded, click on the Save and Close button at the top of the recorder.


7. The steps are saved in the test case. You can now call this reusable component in other test cases. 


Calling the Reusable Component in a Test Case

1. To call the reusable component in a test case, open the test case and add a step where you want to call the reusable component by clicking the Add Step button at the top. Now, in the dropdown at the right of the test step, select reusable component.


2. Search the reusable component you want to call by its name in the search bar on the step. Select the reusable component from the search result.

3. Your test component is added to your new test case. You can click the expand icon to see the steps in the test component. Save the test case by clicking the Save button at the top-right corner to finish the process.



You've reached the end of this article and are now well-prepared to create and execute Reusable Components. 

Ready to dive deeper? Check out the next article: Creating Reusable Components with Keywords

Explore, experiment, and achieve your testing goals on Opkey!












 








Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article