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

Suppose you want to add a Login component to multiple test cases, you can create a single login reusable component and call it in the required test cases.


For example, you want to add a Login to Oracle Fusion reusable component to a test case. Click on the Add Step button and select the desired reusable component.



The added reusable component can be seen added to the test case. 

Similarly, we can add the same reusable component to the other Oracle Fusion test cases.



Once added, you can move the reusable component up or down as needed with the arrow buttons on the panel.



We have now moved the reusable component to the top. Save once all required changes are done.




Updating a reusable component:


If you make an update in a reusable component it will reflect in all the test cases where the reusable component has been used. Thus, before making any changes, we must check in which test cases the reusable component has been used. This will ensure that other test cases are not affected by the change made to the reusable component.

To start, scroll down to the bottom of test case, click the More dropdown, and select Used By.


This will show all the test cases the reusable component has been used. You can verify all the test cases and then choose to update your reusable component accordingly.




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

To understand the best practices to use a reusable component, click here.


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 at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article