UiPath Documentation
studio
2022.10
false
Guide de l’utilisateur de Studio
Important :
La localisation du contenu nouvellement publié peut prendre 1 à 2 semaines avant d’être disponible.

Modèles de cas de test

Use test case templates as base models for your test cases. For example, you can create a template with data variations to be reused on different tests. You can create test case templates for Test Automation projects, including other file types such as Global Exception Handler. For other projects (e.g., Process), you can create workflow templates.

Conditions

  • Les modèles sont spécifiques au type de projet et au langage utilisé pour le créer.

  • Les modèles ne peuvent pas être convertis en workflows, être compilés ou publiés.

  • You can make use of reusable content by creating a library with test case templates. Test data variation is not exported to the library alongside the test case template.

    Important :

    Les ressources référencées dans le modèle ne seront pas copiées localement dans le projet dans lequel vous essayez d'importer la bibliothèque. Le modèle ne doit pas contenir de références à d'autres ressources, telles que les workflows au sein de la bibliothèque.

Sources des modèles

When you add a new file, you can choose a template on which to base it. The templates that you can choose from vary depending on the type of file you are adding (workflow or test case) and on whether you have previously added templates to your project Templates folder.

Modèles intégrés

Cas de test vide

Choose Empty Test Case when you create a test case if you want to add a Placeholder activity that you want to invoke at a later stage.

Cas de test BDD

BDD stands for Behavioural-Driven Development. Choose BDD Test Case when you create a test case to structure your test around Given-When-Then containers.

Modèles de fichiers locaux

The local templates are created in the Templates folder of the project when you extract a file as template and when you add a template to the Templates folder. Local file templates are available only inside the project where you create, or extract them.

You can create local templates of three types: execution template, workflow template, and test case template. When you extract a file as a template, the template type is applied automatically based on the type of file you extract (workflow or test case). When you manually add a template to the Templates folder, you select the type of template to create.

Modèles de fichiers de package

Tester avec délai d'attente

The Test With Timeout template is available only with the Testing activity package, version 22.10 or higher. Choose Test With Timeout when you create a test case if you want to use a timeout or to take screenshots when a verification fails.

Le modèle est configuré pour générer une exception temporelle, en prenant une capture d'écran de l'échec qui s'est produit dans votre workflow.

Remarque :
  • Si vous définissez la variable booléenne takeScreenshotOnException sur false, assurez-vous de modifier la propriété Timeout Message de l'activité TimeoutScope.
  • Vous pouvez modifier le délai d'attente dans la variable duration. La valeur par défaut est de cinq (5) minutes.
  • Vous pouvez conserver des captures d'écran sur votre machine en configurant les paramètres du projet de test.

Ajout d'un modèle de fichier local

You can use the contextual menu in the Project panel to manually add execution, and test case templates based on other templates to your project. After you add a template, you can edit it in the Designer, and then use it as a starting point for creating other files.

  • To add a test case template, right-click the Templates folder, and then select Add > Test Case Template. Follow the test case creation process to configure the template.

  • Pour ajouter un modèle d'exécution, faites un clic droit sur le dossier Modèles (Templates), puis sélectionnez Ajouter (Add) > Modèle d’exécution (Execution Template).

Extraire le fichier comme modèle

  1. Ouvrez votre workflow dans Studio.

  2. Dans le panneau Projet (Project), faites un clic droit sur un cas de test et sélectionnez Extraire en tant que modèle (Extract as Template).

Votre scénario de test est maintenant stocké dans Projet > Modèles. Vous pouvez le copier et le coller ou le déplacer vers votre dossier de test.

Remarque :
  • Vous pouvez créer des modèles directement à partir du dossier Modèles (Templates) pour vos cas de test et vos workflows.
  • You can use the contextual menu within the Templates folder to perform various actions, such as comparing files.

Modèles de Cas de test dans les bibliothèques

You can create test case templates in libraries the same way you create them in processes. After you publish the library, the templates marked as public are available as package file templates in projects where the library is installed.

Création d'un cas de test à partir d'un modèle

  1. Créez un projet de test.

  2. Créez le cas de test que vous souhaitez utiliser comme modèle.

  3. When you finish building the test case, right-click it, and select Extract as Template.

    Name the template, choose the Templates folder as the location to store it in, and select Create. For this example, the name of the template is MyFirstTestCaseTemplate.

  4. Go to the Design tab, in the File group, select New > Test Case. The New Test Case window is displayed.

  5. Give it an appropriate name, and select the template that you previously created from the Template dropdown list. For this example, choose MyFirstTestCaseTemplate.

Suppression d'un modèle

To remove a template, expand the Templates folder in the Project panel, right-click the template, and then select Delete.

Cette page vous a-t-elle été utile ?

Connecter

Besoin d'aide ? Assistance

Vous souhaitez apprendre ? UiPath Academy

Vous avez des questions ? UiPath Forum

Rester à jour