# Xpath in Web application

**URL:** <https://community.automationedge.com/t/xpath-in-web-application/17514>\
**Category:** AutomationEdge UI\
**Tags:** rpa\
**Created:** [February 5, 2026, 12:48pm UTC](https://community.automationedge.com/t/xpath-in-web-application/17514 "2026-02-05T12:48:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akash](https://avatars.discourse-cdn.com/v4/letter/a/a5b964/32.png) [@akash](https://community.automationedge.com/u/akash)\
**Post date:** [February 5, 2026, 12:48pm UTC](https://community.automationedge.com/t/xpath-in-web-application/17514/1 "2026-02-05T12:48:19Z")

</div>

What is Difference Between contains() and starts-with() in XPath Funstion?

---

<div class="post-metadata">

**Author:** ![AETrainings](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@AETrainings](https://community.automationedge.com/u/AETrainings)\
**Post date:** [February 5, 2026, 1:11pm UTC](https://community.automationedge.com/t/xpath-in-web-application/17514/2 "2026-02-05T13:11:31Z")

</div>

In **XPath** , both `contains()` and `starts-with()` are used to match **partial attribute or text values** , but they work differently.

### 🔹 `contains()`

- Checks whether a string **contains** the specified value **anywhere**.

- Useful when the attribute/text has a **dynamic middle part**.

### 🔹 `starts-with()`

- Checks whether a string **starts with** the specified value.

- Useful when the **prefix is fixed** and the remaining part may be dynamic.
