In this article we will learn how to use data driven Test cases in UiPath.
First lets see our workflow, which sum of 3 numbers as shown below.
For above example we will create data driven test cases, lets prepare excel data like this.
in1,in2,in3 are 3 variable we will pass as input to the above workflow ,where as res variable is compared against result of the workflow so that we can understand workflow is been developed correctly or not.
To above workflow right click and in create ->Data Driven Test
Then select the above above prepared excel sheet which our test data sheet and click on import. Don't forget to close the sheet ,if not it will throw error message.
Once imported successfully,you can see the success message in top of the workflow.
First row column names in excel will come into arguments of the workflow ,don't for get to change the argument type based on your requirements.And create a another variable of In/Out type that holds the return value of workflow being called.
If you want to change these values you can change in Given section.
In When section using Invoke Workflow file we will call actual workflow ,that needs to be tested.
Click on Import arguments and pass above argument variables like below
Now we can validate the result of workflow with res of input excel data ,if both are same means workflow is working against expected values, if not there is mismatch between actual values and expected.
To validate I have used Verify Expression With Operator activity of UiPath Testing activities like below.
To run the test cases workflow we need to use Run File with Data variations option.
Hope its useful to you.