How to create a reusable Libraries which returns data and i can use that data in Test scripts

Hi,

I’m new to UIPath Forum, In my Project we are maintaining Test data in Excel sheet. so to read that excel sheets we are creating a libraries and getting the data in Data Table but we are not aware how to Use that DataTable in my Test script as they are in Sequence or Flow Chart. We are able to publish the libraries and able to call the libraries in Process side but they are not returning the data… Someone please help me in this.? or please provide other options which includes library

Hi @Satish_Rongala,

Have you created any out argument in your library?
That is the way to pass the processed data to the caller.

I’m not aware of that… can you help me in this?

Sure!
Tell me your exact requirement.

Sure… we have our Test data present in the Excel Sheets… as like every Test framework we planned to have a Common function library which can used to return data and perform any functional operations etc… So we are able to Create one Sequence in function Library which reads the excel and gives the Data table…but when comes back from library to process type… we able to publish the library and able to call that activity but how can we get the activity returned data table and using that data table in Test case or datatable values passing as a Test data to methods.

1 Like

Sure!
Give Me 20 minutes, Ill build One and upload for your reference.

That will be really helpful for me and i hope you understand my request and what type of requirement looking for… Thank you so much :slight_smile:

Hi Please find the library which i have created for your usage.
ExcelToDataTable_Library.1.0.0.nupkg (9.4 KB)

When you add this package you can find below shown activity, Please specify your excel path in in_ExcelPath , and you can create a data table variable and map it to out_DataTable. This will return the data table.
image

Hope this solves your issue!

2 Likes

Yes, this one will solve my issue… but how can you return the Output as Data table… please let me know also so that i can implement in my other functions…

can you please provide the code… i mean flow chart or sequence that you used… that will be used for my reference… please

1 Like

Here you have to create custom activity as in the below steps:

You can write .net code to create an activity. once is done then you can import the same in UiPath and use it as reusable component.

1 Like

Sure Buddy,

In your library sequence add an out argument, that’s all!
Find the attachment for your reference.ExcelToDataTableByShivu.xaml (6.2 KB)

1 Like

That’s cool… Last and final doubt bro… Can we use only Out argument or can we use in/out type argument also … And what’s the difference between out and in/out argument

Out argument is used when you are returning some value,
In/Out argument is used when you are receiving some input as well as returning some value.
In this case it shouldn’t be in/out because both input and output data types are different.
Hope this solves your Doubt.
Happy automation!:grinning_face_with_smiling_eyes:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.