Stale element not found, is this relate to using same Object?

In terms of a specific implementation, I would understand if they didn’t want to share details, since the Smart Wait feature is proprietary and a selling point for the Studio overall. But I agree, it would be nice to know at least what the methodology is behind it. From my research a couple of years ago, it involved a couple of pieces, but the main one was using a MutationObserver in JavaScript to watch a page change. This is something I’ve replicated myself, coincidentally, and have used with varying success. I don’t think this is the only thing Smart Wait does, but it’s part of it. Here’s the one I created:

if (typeof observer === 'undefined') {
   window.domModifiedTime = Date.now();
   var targetNode = document.querySelector('body');
   var config = {
      attributes: true,
      childList: true,
      subtree: true
   };
   var callback = () => {
      window.domModifiedTime = Date.now();
   };
   var observer = new MutationObserver(callback);
   observer.observe(targetNode, config);
}

After that is injected, you just wait for the domModifiedTime to stop changing, indicating that the page is static.

Again, I’ve had spotty results with this. I think this unreliability is due to varying page loading times and the polling rate of your wait condition. I’ve had it wait perfectly for some page loads, and completely “randomly” for others.