# Assert HTML Element

***assertElement*** method compares the actual value of a html element name with the expected target value. Here the ***attType*** param gives additional information about the html element on with the assertion has to be made.

#### ***Syntax***

***boolean assertElement(String htmlElementName, String attType, String targetValue)***

| **Name**              | **Type** | **Description**                      |
| --------------------- | -------- | ------------------------------------ |
| ***htmlElementName*** | String   | HTML element name                    |
| ***attType***         | String   | Type of the attribute                |
| ***targetValue***     | String   | The actual value of the html element |

#### Code snippet

```
/*
 * Comparing the firstresult of Google search with "https://qatts.com/"
 */

assertElement("li.firstresult", "href","https://qatts.com/");
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.qatts.com/master-1/ui-action-methods/assertion-methods/assert-html-element.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
