studio
2023.4
false
UiPath logo, featuring letters U and I in white

Studio User Guide

Last updated Dec 17, 2024

Test Data Queues

Overview

Make use of the test data queue in Studio by configuring it as a data source or importing it through activities. All imported entities are stored in the Project tab, under Test Data.

For more information on test data queues in Orchestrator, see Test Data Queues.

Note:

Conditions

  • Newly created test data queues are empty, but you can upload queue items based on your defined JSON schema, either directly in Orchestrator, or through Studio.
  • When you use test data queues as source, items are retrieved sequentially from a test data queue regardless if some of them have been consumed.
  • To Run and Debug test cases with dynamic test data, use the Test Explorer. The data comes from the test data queue during runtime, and the Test Explorer populates the values at runtime.

Known limitation

When you define an input argument value directly from the Orchestrator UI for a data-driven test set, the value does not pass to the test variations.

Workaround: Add the input argument directly to the Test Data Queue items.

Add Test Data Queue Items

You can add test data queue items to your workflows either through activities or as a data source to a test case.

Add items through activities

To add items to your test data queue using an activity, you need to create a custom workflow and configure an activity to import data from a test data queue in Orchestrator.

  1. Open Studio.
  2. Open or create a new Test Automation project.
  3. Navigate to New > Test Case.
  4. Add an Add Test Data Queue Item activity to the Designer panel and go to Properties to configure the QueueName to match test your Orchestrator test data queue.

    Note: Make sure that you are connected to an Orchestrator instance.
  5. In the Testing > Data activities list, add multiple activities of your own choice to the Add Test Data Queue Item activity. For more information, see Test Data Activities.
  6. Configure your activities to match your synthetic user data scenario.

    Important: A valid queue item must have the exact name, as defined in your JSON schema. For example, if you have defined a givenName property in your JSON schema, your corresponded Given Name activity should match this (e.g. DisplayName set to givenName). For more information, see JSON Schema Definition.
  7. Open the Variables panel to define your variables.
  8. Save your test case.
  9. In the Project panel, right-click on your test case and select Set as publishable
  10. Click Publish and configure the package properties.
  11. Click Run File.

    Note: Alternatively, you can create a custom input form to easily configure and generate synthetic user data. For more information, see Create Form.

Add test data queue as data source to test case

When you create test cases, you can configure the data source to point to a test data queue, to make use of Data-driven testing.

  1. Create a new test case with test data, or update an existing test case with test data.
  2. Click Source and select Test Data Queue from the dropdown list.
  3. Select a test data queue or use the search function to look for it.
  4. (Optional) Filter the test data queue to retrieve only specific items using the built-in Query Builder.

    Use the Range option to set the desired range of items. The first field represents the starting index for the range, and the second field is the number of items to retrieve.



  5. Click Create to add test data (test data queue) to the test case.
    An argument with the name of the test data queue is generated in the Arguments panel of your project. For the illustration above, the name of the argument is workforce.
    Important: The name of the test data queue argument must stay the same. If you change the name of the argument, you won't be able to access the data anymore. For example, if you change the name of the argument from workforce to Work_Force_Queue, you won't be able to access the corresponding data.

Update Test Data Queue Items

You can update test data with test data queue as source.

  1. Open Studio and navigate to your project.
  2. In the Project panel, right-click a test case with data variations and select Update test data.
  3. Click Source and select Test Data Queue from the dropdown list.
  4. Select a test data queue or use the search function to look for it.
  5. (Optional) Click Update all test cases using the same test data to update all test cases from the current project that use the test data that you are updating.
  6. (Optional) Filter the test data queue to retrieve only specific items using the built-in Query Builder.

    Note: You can perform this action in Test Explorer by right-clicking a file, and then choosing Update Test Data.

Retrieving test data queue items

In this tutorial, you will learn how to retrieve test data queue items, to perform data-driven testing. Data-driven testing allows you to efficiently test different data scenarios using test data queue items as input. Follow the steps below to retrieve and use test data queues in your test cases.
  1. Create a Test Automation project.
  2. From the File group, in the Design ribbon, create a new test case.
    1. In the Test Data tab, choose the Source as Test Data Queue.
      In this example, we selected the loan_quote_queue test data queue.

    2. Click Create.
      With the test case, an argument is also created automatically in the Arguments panel, carrying the name of the test data queue.
      Important: Leave the argument name untouched. Otherwise, you won't be able to retrieve the data from the test data queue.
  3. To retrieve the items from the test data queue, input the generated argument, and then access the columns that you want to retrieve. You can use the following format for retrieving the items: <testDataQueueName>("<columnName>").toString.
    In this example, we added a Log Message activity, and in the Message field we input loan_quote_queue("first_name").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.