That was a great topic to discuss. Thanks for bringing it up.
As you are saying, there are various ways and each has its own use…
Library : When you want to just build some logic which can be re-used
UiObjRepo : When you want to reuse the same element selectors again either inside a single project or multiple projects
Activity direct method : This is a common way which I’m not gonna get into now.
The above points may give some idea.
Let’s say you are building RPA for a well known tech giant which may have n number of processes to be automated
So now let’s assume, you have 5 processes to be automated for an insurance client,
Claim request processing
Applying for additional dependants
Cancelling a claim or policy
Policy cover enquiry
All these process will be using one single application which may be called as IMS (Insurance management system)
So the general flow may be like this for all the processes,
Login -> Process -> Logout
Login and logout will be for sure similar for all the processes as they use IMS.
Process will be having reusable ui elements from the IMS. The business steps performed may be different but still the fields used may be still same upto a major extent let’s say 70-80%
Now you will be having 5 automation projects and 1 Library with IMS Login, Logout & All the IMS Ui-Elements required will be captured and stored.
This library will be invoked in all the 5 projects where you will reuse login as well as the elements.
So whenever there is a change in the IMS UI it’s easy to maintain like you just go to library capture the UiElement again and then just update in all the 5 processes.
So efforts are drastically reduced to 1/5.
And it won’t stop here tomorrow if there is a new process from IMS development time will also be drastically reduced as you already captured the selectors and your duty will be to just build the flow.
So overall it’s a good approach to go with libraries provided you have a scope to reuse to things as mentioned above.
For all enterprise based landscape, we will be having above scenarios 90% of the time.
Hope this helps.