> For the complete documentation index, see [llms.txt](https://docs.walnutai.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.walnutai.ai/getting-started/managing-your-profile-and-assets/object-repository/object-parameterization-in-walnutai.md).

# Object Parameterization in WalnutAI

Object Parameterization in WalnutAI allows you to replace hardcoded object values within a test step with dynamic parameters. This makes the same object reusable across different test steps, datasets, and execution scenarios without modifying the underlying test logic.

Instead of defining fixed values such as usernames, email addresses, account numbers, or search terms directly in an object, you can associate the object with a parameter. The parameter can then be assigned the required value, allowing the same object to be used with different values whenever needed.

**Key Benefits of Object Parameterization**

* Scalability: Reuse the same locator across different test cases.
* Flexibility: Handle dynamic elements without modifying test scripts.
* Efficiency: Reduce maintenance efforts when UI changes.
* Data-Driven Testing: Easily integrate with different datasets.

#### **1. Creating a Parameter from the Parameter Section**

You can create a parameter from the Parameter section of a test case and then associate it with the required object.

* Open the required test case.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FT1g0Fje5ZgEwxslli4z6%2FScreenshot%202026-08-19%20at%204.42.08%E2%80%AFPM.png?alt=media&amp;token=504ea1d0-67c7-4d6e-bc33-a0cac3fba221" alt=""><figcaption></figcaption></figure>

* Navigate to the Parameter section.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FV6vsf5NXakoIkRRbD94n%2FScreenshot%202026-08-19%20at%204.42.47%E2%80%AFPM.png?alt=media&amp;token=f43e5b78-ac89-4c59-a94d-5b2bd22a8c1e" alt=""><figcaption></figcaption></figure>

* **Create a new parameter and e**nter the following details:

  * **Parameter Name:** A descriptive name for the parameter, such as `Email`.
  * **Parameter Key:** A unique key used to reference the parameter in a test step, such as `email`.
  * **Description:** A brief description explaining the purpose of the parameter, such as `Email address used for login or user identification`.

  <figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2Fnm4H1dJ41mYCkUTFWvn4%2FScreenshot%202026-08-19%20at%204.51.58%E2%80%AFPM.png?alt=media&amp;token=5324b3d8-d55a-415c-8e02-1c8d04006c24" alt=""><figcaption></figcaption></figure>

* Click **Create Parameter** to create the parameter.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FO5lnxvbt9r9B4bc33YJf%2FScreenshot%202026-08-19%20at%204.52.56%E2%80%AFPM.png?alt=media&amp;token=f6d3029d-1b5f-4e13-9dfd-73ccc9a43850" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The newly created parameter will appear in the **Parameter** section. Based on the parameter type **Local, Global, or Runtime,** its availability and value handling will differ. The parameter will be reflected in the **Test Data** section only after it is used in a test step.
{% endhint %}

#### **2. Parameterizing an Object Directly from a Test Step**

You can also parameterize an object directly while editing a test step.

* Select the required test step.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2Fk4d7zw2aulj5vdkTDSAN%2FScreenshot%202026-08-19%20at%205.00.13%E2%80%AFPM.png?alt=media&amp;token=ffcd6c2a-5a75-46cc-a798-de95d768a7a7" alt=""><figcaption></figcaption></figure>

* Click the Object icon.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FggOgm7bXCRXMyVNUOFj5%2FScreenshot%202026-08-19%20at%204.56.30%E2%80%AFPM.png?alt=media&amp;token=0f052820-0326-4c3a-b2dc-1b724fbadb92" alt=""><figcaption></figcaption></figure>

* Identify the hardcoded value in the object.

For example, if the object locator contains:

`//input[@placeholder='admin@example.com']`

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FGvpWUxhLbxDKx0FDvEPj%2FScreenshot%202026-08-19%20at%205.01.23%E2%80%AFPM.png?alt=media&amp;token=addb837f-100f-4f7d-9ff7-b46626c8b3e2" alt=""><figcaption></figcaption></figure>

* Replace the hardcoded value with the parameter name you want to create.

Replace the hardcoded value with the parameter:

`//input[@placeholder='${Email}']`

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2Fo02881xWIurCJsV4aJCV%2FScreenshot%202026-08-19%20at%205.02.13%E2%80%AFPM.png?alt=media&amp;token=cd661a73-82f7-4b09-b003-56a2e1f97512" alt=""><figcaption></figcaption></figure>

* Save the step.

<figure><img src="https://295337183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9aroNmDWVJAmMjkdy0hx%2Fuploads%2FJwH8Zb5rl3q7z4k05ytU%2FScreenshot%202026-08-19%20at%205.02.44%E2%80%AFPM.png?alt=media&amp;token=e4b04093-74b0-4e4c-849c-1f4577ca8612" alt=""><figcaption></figcaption></figure>

#### **Understanding Local, Global, and Runtime Parameters**

The value requirement depends on the parameter type:

* **Local Parameter:** The parameter is specific to the current test case. A value must be provided for the local parameter within the test case.
* **Global Parameter:** The parameter can be reused across multiple test cases. When creating a global parameter, make sure to provide its value
* **Runtime Parameter:** The parameter can be reused across multiple test cases without providing a value when it is created.&#x20;
