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.
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:
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.
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.
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.
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.
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.
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
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>.
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.
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?
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
Open your test case and select the Command (e.g., click, type, or waitForElementPresent).
Click on the Target field.
Type your XPath using the syntax above (e.g., xpath=//button[contains(text(), 'Login')]).
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!
If @marcusdardy wants to learn XPath in general, should read the following article:
Especially for contains(xx,xx), should read the following article:
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
those ids (…_CalendarExtender_day_0_5) come from the 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:
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.