# Cannot find element error

**URL:** <https://forum.katalon.com/t/cannot-find-element-error/194334>\
**Category:** Web Testing\
**Tags:** web-testing\
**Created:** [October 3, 2026, 2:27am UTC](https://forum.katalon.com/t/cannot-find-element-error/194334 "2026-10-03T02:27:43Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcusdardy](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@marcusdardy](https://forum.katalon.com/u/marcusdardy)\
**Post date:** [October 3, 2026, 2:27am UTC](https://forum.katalon.com/t/cannot-find-element-error/194334/1 "2026-10-03T02:27:43Z")

</div>

I am using Katalon Recorder and when I record during web testing and get this error. I don’t know what to do to fix this error or get around it. I have tried putting in waitForElementPresent command but that doesn’t fix it either. Does someone have any ideas on what to do to fix or get around this type of error?

Here is an screenshot of an example of when the error occurs and me putting in waitForElementPresent command.

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/8/d/8da1fc127af6976426b6a5158ca71ec8b913ca53.png)

---

<div class="post-metadata">

**Author:** ![nghi.phan](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/nghi.phan/32/30970_2.png) [@nghi.phan](https://forum.katalon.com/u/nghi.phan)\
**Post date:** [October 3, 2026, 2:31am UTC](https://forum.katalon.com/t/cannot-find-element-error/194334/2 "2026-10-03T02:31:18Z")

</div>

> [@marcusdardy](#):
>
> I am using Katalon Recorder and when I record during web testing and get this error. I don’t know what to do to fix this error or get around it. I have tried putting in waitForElementPresent command but that doesn’t fix it either. Does someone have any ideas on what to do to fix or get around this type of error?
> 
> Here is an screenshot of an example of when the error occurs and me putting in waitForElementPresent command.

The screenshot shows an **“Element … not found”** error on a calendar date cell and not on the date input itself. The `type` commands for the date fields are green, while the calendar clicks are red. That suggests you may be able to avoid the calendar altogether.

**Try this first:**  
• For one date field, remove the steps that open/navigate/click the calendar and keep just one `type` command targeting the date input, with the date in the format your application expects.  
• If the application requires it, move focus to another field afterward so it processes the change.  
• Replay that section and check that the application actually retains/saves the intended date. A green `type` step alone doesn’t prove it accepted the value.

**If you need to test the calendar itself:** open it during replay and inspect the locator for the intended date. Targets ending in `CalendarExtender_day_0_5` appear to identify a calendar-grid position, so verify that the same element exists in the displayed month before relying on it. A wait won’t fix a locator that no longer matches.

Also, one screenshot row waits for `…day_2_3` but then clicks `…day_0_5`. Make the wait and click target the **same intended element**.

This is preliminary based on your screenshot. If it still fails, please share the Recorder/browser versions and whether the calendar is visibly open when the failing click runs.

---

<div class="post-metadata">

**Author:** ![dineshh](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/dineshh/32/24488_2.png) [@dineshh](https://forum.katalon.com/u/dineshh)\
**Post date:** [October 3, 2026, 3:42am UTC](https://forum.katalon.com/t/cannot-find-element-error/194334/3 "2026-10-03T03:42:00Z")

</div>

> `waitForElementPresent` is useful only when the recorded Test Object correctly identifies an element in the current page/frame. If it still cannot find the object, the issue is usually the locator or browser context—not just timing.
> 
> I would check these items:
> 
> 1. **Inspect the Test Object locator** captured by Recorder. Avoid dynamic IDs, generated CSS classes, and long absolute XPath values. Prefer a stable `id`, `name`, `data-testid`, accessible label, or a short relative XPath/CSS selector.
> 
> 2. **Confirm whether the element is inside an iframe.** If it is, Katalon must switch into that iframe before it can find the element, then switch back to the default content afterward.
> 
> 3. **Check for Shadow DOM.** Standard XPath often cannot locate elements inside a shadow root. Try Katalon’s Smart Locator or update the parent/shadow-root configuration.
> 
> 4. **Wait for the appropriate state immediately before the action.** For a click, use a wait for visibility/clickability rather than only presence—an element can exist in the DOM but still be hidden or covered.
> 
> 5. **Re-capture the object with Spy/Recorder Plus** and manually review which attributes are selected. Recorder can capture dynamic attributes that change between recording and playback.
> 
> Example:

> `WebUI.waitForElementVisible(findTestObject('Page_Example/btn_Submit'), 15)`  
> `WebUI.waitForElementClickable(findTestObject('Page_Example/btn_Submit'), 15)`  
> `WebUI.click(findTestObject('Page_Example/btn_Submit'))`

Please share the exact error text, the Test Object’s locator, and whether the element is in an iframe or Shadow DOM. That will identify the real cause quickly.

## Why their wait may not work

`waitForElementPresent` waits until an element is present in the **current view** and returns `true` or `false`; it does not repair a bad selector or automatically switch to an iframe.

Also, Recorder may capture dynamic CSS attributes that no longer exist during playback. Katalon specifically recommends manually reviewing and adjusting those locators; closed Shadow DOM cannot be recorded/supported in the normal way

## Practical locator guidance

| Situation | What to do |
| --- | --- |
| Dynamic ID such as `btn-48291` | Ask developers for `data-testid`, or use a stable semantic attribute |
| Element appears after AJAX | Wait for visible/clickable state immediately before interaction |
| Element in iframe | Switch to the iframe first |
| Element in open Shadow DOM | Use Smart Locator or configure the Shadow DOM parent |
| Element is hidden under a loader/modal | Wait for loader to disappear, then wait for target to be clickable |
| New browser tab/window | Switch to the target window before locating it |

Katalon supports XPath, attributes, CSS, image, and Smart Locator strategies. Smart Locator is particularly intended for complex scenarios such as dynamic IDs, nested iframes, SVG, and Shadow DOM

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [October 3, 2026, 5:57pm UTC](https://forum.katalon.com/t/cannot-find-element-error/194334/4 "2026-10-03T17:57:18Z")

</div>

I think you may have dynamic `<id>` and that is why you are getting ‘Element not found’. Dynamic addressing means that the pathway to your element **changes** every time you launch your application. I think this because you have identifiers like id=…\_2\_1 and id=…\_0\_5. Take a look at your application again and see if you can find the same identifiers as you have in your image. If you have dynamic `<id>`, you won’t find them, however, you can still use Katalon to test your application, but you have to change your pathways NOT to use `<id>` **or** to use “contains” or “starts-with” in your pathway and remove the numbers from your `<id>`.

Example:

```auto
//*[contains(@id,'MainContent_Zone2_wpAuditStartInfo_ddsAuditStartDate_CalendarExtender_day')]

```

or

```auto
//*[starts-with(@id,'MainContent_Zone2_wpAuditStartInfo_ddsAuditStartDate_CalendarExtender_day')]

```

note: the asterisk is used because I don’t know what the tag of the element is.

---

<div class="post-metadata">

**Author:** ![arvind.choudhary](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/arvind.choudhary/32/33165_2.png) [@arvind.choudhary](https://forum.katalon.com/u/arvind.choudhary)\
**Post date:** [October 5, 2026, 3:18am UTC](https://forum.katalon.com/t/cannot-find-element-error/194334/5 "2026-10-05T03:18:09Z")

</div>

If your primary goal is not to validate the calendar icon functionality, you can simply enter the date directly in the required format and proceed with your testing. However, if you also want to verify the calendar icon behavior, please try the suggested solutions and let us know whether they help resolve the issue.

---

<div class="post-metadata">

**Author:** ![marcusdardy](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@marcusdardy](https://forum.katalon.com/u/marcusdardy)\
**Post date:** [October 5, 2026, 3:22am UTC](https://forum.katalon.com/t/cannot-find-element-error/194334/6 "2026-10-05T03:22:05Z")

</div>

Hello and thanks for your help and the others as well.

In order to change the pathways to not use or to use “contains” or “starts-with” in my pathway in Katalon to remove the numbers from , where do I put the examples that you provided? Do I need to add a new tag for those as click command in the Katalon test?

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [October 5, 2026, 2:53pm UTC](https://forum.katalon.com/t/cannot-find-element-error/194334/7 "2026-10-05T14:53:30Z")

</div>

In your image, you currently have “id=…”. Change this to become: “xpath=…”, with the xpath as the ones with “contains()”,

This is from Google AI:

To find elements in **Katalon Recorder** using the `contains()` function, you will use **XPath**. This is highly useful for locating elements with dynamic text or attributes that change frequently.

**The Standard XPath Syntax**

In Katalon Recorder’s **Target** field, use the following formats:

- **By Text:** `xpath=//tag_name[contains(text(), 'your_text')]`
- **By Attribute:** `xpath=//tag_name[contains(@attribute_name, 'value')]`

* * *

**Common Examples to Copy & Paste**

| **Type** | **Target Syntax Example** | **Use Case** |
| --- | --- | --- |
| **Partial Text** | `xpath=//button[contains(text(), 'Submit')]` | Matches a button that says “Submit Info” or “Click to Submit”. |
| **ID Attribute** | `xpath=//input[contains(@id, 'user-button-')]` | Matches an ID like `user-button-12345` where numbers change. |
| **Class Attribute** | `xpath=//div[contains(@class, 'active-menu')]` | Matches a div that has multiple classes, including `active-menu`. |
| **Any Tag (\*)** | `xpath=//*[contains(text(), 'Welcome')]` | Finds _any_ element on the page containing the word “Welcome”. |

* * *

**Step-by-Step Pathway in Katalon Recorder**

1. Open your test case and select the **Command** (e.g., `click`, `type`, or `waitForElementPresent`).
2. Click on the **Target** field.
3. Type your XPath using the syntax above (e.g., `xpath=//button[contains(text(), 'Login')]`).
4. Click the **Find** button next to the Target field. Katalon Recorder will flash a green boundary around the element on your web page to confirm it works.

**💡 Quick Tips**

- **Case Sensitivity:** The `contains()` function in XPath 1.0 (used by most browsers) is **case-sensitive**. Make sure your text matches the exact casing on the screen.
- **Inner Spaces:** If your text has strange spacing, you can combine it with `normalize-space()` like this:  
`xpath=//button[contains(normalize-space(text()), 'Submit')]`

If you are trying to target a specific tricky element, let us know the **tag type** (like button, input, div) and the **text or attributes** it has, and we can write the pathway for you!

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [October 6, 2026, 7:36am UTC](https://forum.katalon.com/t/cannot-find-element-error/194334/8 "2026-10-06T07:36:26Z")

</div>

If @marcusdardy wants to learn XPath in general, should read the following article:

> **[XPath in Selenium: Tutorial](https://www.guru99.com/xpath-selenium.html)**
>
> XPath in Selenium: Learn XPath definition, Types, Basic XPath, Contains, OR & AND, Starts-with Function, XPath Axes Methods, and more.

Especially for contains(xx,xx), should read the following article:

> **[XPath Contains: Text, Following Sibling & Ancestor in Selenium](https://www.guru99.com/using-contains-sbiling-ancestor-to-find-element-in-selenium.html)**
>
> XPath Using Contains, Sibling, Ancestor Commandes to Find web Element for our test script in Selenium.

In order to write valid xpath expressions that use `contains(text(), 'XXXX')`, @marcusdardy would need to view the DOM of the target web page to find out what to write as `'XXXX'`. @marcusdardy would want to know how to view the DOM of a web page in action on chrome browser, should read the following article

> **[Get started with viewing and changing the DOM  |  Chrome DevTools  |  Chrome...](https://developer.chrome.com/docs/devtools/dom)**
>
> How to view nodes, search for nodes, edit nodes, reference nodes in the Console, break on node changes, and more.

---

<div class="post-metadata">

**Author:** ![depapp](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/depapp/32/29178_2.png) [@depapp](https://forum.katalon.com/u/depapp)\
**Post date:** [October 9, 2026, 8:44am UTC](https://forum.katalon.com/t/cannot-find-element-error/194334/9 "2026-10-09T08:44:54Z")

</div>

hi @marcusdardy

those ids (…\_CalendarExtender\_day\_0\_5) come from the [asp.net](http://asp.net) ajax calendar extender. the two numbers are the row and column of the cell in the grid, not the date. so day\_0\_5 is “first row, sixth column”, which is a different date every month, that is why the click works while recording and fails later.

in recorder, change the target from id= to xpath= and pick the cell by the number you can see instead:

```auto
xpath=//div[contains(@id,'ddsAuditStartDate_CalendarExtender_day_') and normalize-space()='15']

```

replace 15 with the day you want, and keep the ddsAuditStartDate part so it does not match the other date field’s calendar. click the Find button next to the target to check it highlights the right cell while the calendar is open.

if the test is not about the calendar itself, bella’s advice is simpler: delete the calendar clicks and just type the date into the input, then press tab (sendKeys with ${KEY\_TAB}) so the page fires the change event and keeps the value.

---

<div class="post-metadata">

**Author:** ![dineshh](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/dineshh/32/24488_2.png) [@dineshh](https://forum.katalon.com/u/dineshh)\
**Post date:** [October 17, 2026, 8:18am UTC](https://forum.katalon.com/t/cannot-find-element-error/194334/10 "2026-10-17T08:18:45Z")

</div>

did you try any of the above suggestions? does these resolve your query?
