# Creating your first coded test case

> Create a coded test case in Studio that types data into a web form and verifies it using Object Repository elements and Test Manager.

This tutorial provides step-by-step instructions for creating a coded test case that types information into a web form and verifies it using Test Manager. To automate the web form and access it, the example uses **Object Repository** elements and **UIAutomation**. You can access the sample form [here](https://uipathtestappsto.blob.core.windows.net/testapps/form.html).

## Prerequisites
* [UiAutomation.Activities](https://docs.uipath.com/activities/other/latest/ui-automation/ui-automation-apis) 23.10
* [Testing.Activities](https://docs.uipath.com/activities/other/latest/workflow/testing-apis) 23.10
* UiPath Chrome extension
1. Create a coded test case. From the **File** group, select **New**, and then **Coded Test Case**.

The code for the test case is split into three parts (**Arrange-Act-Assert**), similar to the **[Given-When-Then](https://docs.uipath.com/studio/standalone/2026.10/user-guide/built-in-templates#built-in-templates)** template.
   * **Arrange** – Setup test data.
   * **Act** – Perform test case steps.
   * **Assert** – Verify the test case result.
2. Retrieve the UI elements from your testing application, so you can use them in your Coded Test Case. For this example, retrieve the UI elements from the web form. Go to the [Object Repository](https://docs.uipath.com/studio/standalone/2026.10/user-guide/creating-an-object-repository#creating-an-object-repository) tab and create an application named **TestForm**.
3. Inside the **TestForm** application, create a screen named **TestFormScreen**, and indicate the Chrome tab where the web form is open.

   ![Object Repository TestFormScreen screen setup indicating the Chrome web form tab](https://dev-assets.cms.uipath.com/assets/images/studio/studio-docs-image-271412-52937302.webp)
4. Inside the **TestFormScreen** create an element for every form field, and buttons inside the form. The UI elements are ordered alphabetically, in ascending order.

   ![Object Repository TestFormScreen with UI elements for each web form field and button](https://dev-assets.cms.uipath.com/assets/images/studio/studio-docs-image-271408-2648a690.webp)
5. Start designing your Coded Test Case, using the [UIAutomation](https://docs.uipath.com/activities/other/latest/ui-automation/ui-automation-apis) and [Testing](https://docs.uipath.com/activities/other/latest/workflow/testing-apis) services.
6. In the **Arrange** section use the **UIAutomation** service along with the [Open](https://docs.uipath.com/activities/other/latest/ui-automation/uipath-uiautomationnext-api-contracts-iuiautomationappservice-open) and [TypeInto](https://docs.uipath.com/activities/other/latest/ui-automation/uipath-uiautomationnext-api-models-uitargetapp-typeinto) coded automation APIs to open the web form and input test data. For this example, use the following code sample:
   ```
   var screen = uiAutomation.Open(ObjectRepository.Descriptors.TestForm.TestFormScreen);
               screen.TypeInto(ObjectRepository.Descriptors.TestForm.TestFormScreen.Name, "John Doe");
               screen.TypeInto(ObjectRepository.Descriptors.TestForm.TestFormScreen.Email, "john.doe@uipath.com");
               screen.TypeInto(ObjectRepository.Descriptors.TestForm.TestFormScreen.Password, "1234");
               screen.TypeInto(ObjectRepository.Descriptors.TestForm.TestFormScreen.ConfirmPassword, "1234");
   ```
   :::tip
   Use IntelliSense inside the Studio IDE. Press `Ctrl+Space` and use IntelliSense for:
   * Autocompleting code
   * Reading coded automation API documentation –
   reading the parameters of an API. In the Coded automations ecosystem, API parameters are the equivalent of activity properties. ![Studio IntelliSense showing coded automation API parameters in the IDE](https://dev-assets.cms.uipath.com/assets/images/studio/studio-docs-image-296544-28c499db.webp)
   :::

![Coded test case editor with Arrange section code using UIAutomation Open and TypeInto APIs](https://dev-assets.cms.uipath.com/assets/images/studio/studio-docs-image-296553-f77334a4.webp)
7. In the **Act** section type the action of submitting the form. For this example, use the following code sample:
   ```
   screen.Click("Submit");
   ```

![Coded test case editor with Act section code calling screen Click Submit](https://dev-assets.cms.uipath.com/assets/images/studio/studio-docs-image-296569-ff1d19d5.webp)
8. In the **Assert** section use the **Testing** service, along with the [VerifyExpression](https://docs.uipath.com/activities/other/latest/workflow/uipath-testing-api-itestingservice-verifyexpression) coded automation API, to verify if the text inside **Verification** is the username input from step 6. For this example, use the following code sample:
   ```
   testing.VerifyExpression(screen.GetText("Verification") == "John Doe");
   ```

![Coded test case editor with Assert section code using VerifyExpression to validate form output](https://dev-assets.cms.uipath.com/assets/images/studio/studio-docs-image-296573-594035fd.webp)

## Result

The coded test case is created and runs the Arrange-Act-Assert verification. The test result is visible in the Test Explorer.

## Sample project

To follow the steps and try out the tutorial yourself, download the following sample project: [First coded test case](https://dev-assets.cms.uipath.com/assets/examples/CodedAutomations/CreatingYourFirstCodedTestCase.zip).
