Critical Stability Issue Using Kane AI: KeyError 'xpath'

So I am using Kane AI to automate a script within Oracle ERP, so when i go in and author it using Kane ai it proceeds to do all the steps based off the commands I give and once I have saved the changed the produced code will say code validation failed. When I went into the error logs I saw after a “Save” action, the script attempts to interact with the next element (e.g., the Invoice Actions dropdown). It often results in a stale element reference: stale element not found in the current frame. When the script fails to find the next element due to the unstable DOM, KaneAI “Heal” process triggers status: 500 error and **KeyError: 'xpath'.

Solutions I Have Tried:**

  1. Standard Wait Actions: Added hard waits up to 10 seconds, but Oracle’s “Glass Pane” or background refreshes often exceed this or happen after the wait finishes.

  2. Custom JS Sync Script: Used the following script to check Oracle’s internal synchronization, but it returns null in the KaneAI execution environment

Is there a known issue with async JavaScript snippets returning null in the KaneAI environment for Oracle ADF? How can I ensure the test pauses until the Oracle isSynchronized state is true to prevent the KeyError: 'xpath' during auto-healing?

my understanding from your problem

Oracle ERP refreshes the page after a Save action. This destroys and rebuilds elements in the DOM. Your script is trying to use an old element that no longer exists, which causes the stale element error. Kane AI then tries to heal the step but fails because it can’t find a valid locator.

possible solution:

  1. After every Save, wait for the page to fully finish loading. Do not use fixed delays. Instead, wait for loaders or overlays (like the glass pane) to disappear.

  2. Always re-locate the next element before interacting with it. Do not reuse previously found elements.

  3. Add retry logic. If an action fails due to a stale element, try finding and interacting with the element again a few times.

  4. Use more reliable locators. Avoid relying only on XPath. Prefer stable IDs, data attributes, or visible text.

  5. Do not rely on Oracle ADF synchronization scripts like isSynchronized(), as they are not reliable in this environment.

Key rule: After any page update, always wait, re-find the element, then perform the action, retrying if necessary.