> For the complete documentation index, see [llms.txt](https://docs.precisiontestautomation.in/scriptlessautomation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.precisiontestautomation.in/scriptlessautomation/automation-platforms/scriptlessweb-automation/web-automation-key-phrases/element_name.md).

# ELEMENT\_NAME

#### Definition of **ELEMENT\_NAME**

`ELEMENT_NAME` is a key component in web automation scripts that directly references a web element defined within a `PAGE_NAME` properties file. It is the identifier or key associated with a specific web element's locator.

#### Relationship with PAGE\_NAME

* Each `ELEMENT_NAME` is defined within a `PAGE_NAME` property file.
* The `PAGE_NAME` property file acts as a repository for all `ELEMENT_NAME` entries and their corresponding locators.
* `ELEMENT_NAME` allows the automation script to abstract the direct locator details and refer to elements in a readable and maintainable way.

#### Example Usage

Given a `SwagLabs.properties` file with the following content:

{% code lineNumbers="true" %}

```
# SwagLabs.properties
pageTitle = CSS -> .login_logo
userName = CSS -> #user-name
password = CSS -> #password
loginButton = CSS -> .btn_action
errorMessage = CSS -> .error-message-container.error
```

{% endcode %}

An automation script would use `ELEMENT_NAME` as follows:

{% code lineNumbers="true" %}

```
# Example automation script snippet
PAGE_NAME, WAIT_TYPE, SCROLL_TYPE, ELEMENT_NAME, ACTIONS, SEND_KEYS, VALIDATION, VALIDATION_TYPE
SwagLabs, VISIBILITY, NONE, userName, SEND_KEYS, testuser, NONE, NONE
SwagLabs, VISIBILITY, NONE, password, SEND_KEYS, testpassword, NONE, NONE
```

{% endcode %}

In this snippet:

* `userName` and `password` are `ELEMENT_NAME` entries.
* The automation framework searches for these within the `SwagLabs.properties` file to find the corresponding locators.

#### Advantages of Using ELEMENT\_NAME

* **Maintainability**: Changes to element locators need only be updated in the property files, not in every individual test script.
* **Readability**: Scripts are more readable and understandable when using meaningful `ELEMENT_NAME` entries.
* **Scalability**: New elements can be added to the property files without altering the test scripts.
