studio
2023.4
false
UiPath logo, featuring letters U and I in white
Studio User Guide
Last updated Nov 4, 2024

Data Service

Overview

You can use Data Service, both in Automation Cloud and Automation Suite, as a source for your data-driven testing. The data is imported from Data Service entities, exposing the fields as workflow arguments. All imported entities are stored in the Project tab, under Entities.

You can perform data-driven testing with Data Service only with version 22.4 or higher of the Testing.Activities package.

Important: After importing a data service entity, an argument is generated in the Arguments panel. The name of the argument must stay the same. If you change the name of the argument, you can't access the data anymore.

Conditions

  • When you configure a Data Service source, the data is fetched from the first entry in the enitity.
  • To Run and Debug test cases with dynamic test data, use the Test Explorer. The data comes from the Data Service entity during runtime, and the Test Explorer populates the values at runtime.
  • If you close your session and open the project again, you need to run the file with data variation again to load the test data.
  • If you update the entity, you need to run the file with the data variation to load the updated test data.
  • Test cases with data variations that are empty are marked as failed.
  • A test case setup is created in Orchestrator, when you execute test cases containing data variations from Data Service.

Known limitation

If you create a data-driven test case that accepts an input argument, publish it in a test set, and attempt to define the argument value directly from the Orchestrator UI, the input argument value does not get passed to the test variations.

Workaround: To overcome this limitation, add the input argument directly to the Data Service entity.

Applying entity filters

When you add test data to your test case, you can filter the entity to retrieve only specific fields from Data Service. You can configure the filters by using the built-in Query Builder.

  1. Create a new test case with test data, or add test data to an existing test case.
  2. Click Source and select Data Service from the dropdown list.

    Note: If the option is not available, check the requirements.
  3. Select an entity or use the search function to look for it.
  4. Click the Filter icon to open Query Builder.
  5. Use the first dropdown list to filter by a criterion (e.g., CreateTime).
  6. (Optional) You can add rows and groups when you click Add and then configure the conditions.
  7. (Optional) You can select to filter by all or any of your criteria by choosing AND or OR.
  8. Enter a Name for your filter.
  9. (Optional) Use the Range to configure specific row intervals. This is useful if you have hundreds of fields in your entity.
  10. Click OK to confirm.

    The data is fetched from the entity and added to the test case as an Argument Type. Only the first entry in the entity is fetched. You can access the data through the arguments.



Retrieving data service entities

In this tutorial, you will learn how to retrieve data service entities, to perform data-driven testing. Data-driven testing allows you to efficiently test different data scenarios using data service entities as input. Follow the steps below to retrieve and utilize data service entities in your test cases.

  1. Create a Test Automation project.
  2. In the Design ribbon, click Manage Entities.
    1. Deselect all entities, and select only the ones that you want to retrieve in your test case.
      In this example, we only selected the Billings entity.


    2. Click Save to add the selected entities to your project.
  3. Create a new test case.
    1. In the Test Data tab, choose the Source as Data Service.
    2. Select the entities that you want to use in your test case.
      In this example, we selected the Billings entity again.


    3. Click Create.
      With the test case, an argument is also created automatically in the Arguments panel, carrying the name of the entity. The type of the argument represents the namespace of the project and the name of the entity you selected as data source.
      Important: Leave the argument name untouched. Otherwise, you won't be able to retrieve the data from the entity.
  4. To retrieve the fields from the entity, input the generated argument, and then access the fields that you want to retrieve. You can use the following format for retrieving the fields and records in the entity: <dataEntityName>.<fieldName>.toString.
    In this example, we added a Log Message activity, and in the Message field we input billings.Data.toString.


Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.