Error message: Could not establish connection. Receiving end does not exist

I have a fairly simple macro that fails randomly - sometimes it will fail after a couple hundred tries, sometimes it will fail after as little as two tries. It always shows the error: “Could not establish connection. Receiving end does not exist.” It shows this error after executing an XClickRelative action, and the page it’s hanging on is always successfully loaded and is showing exactly what it should - when I manually start another loop, it always picks up just fine until it randomly fails again. How can I troubleshoot and solve this?

I have reviewed the following three threads which report this same error:

forum.ui.vision/t/recreator-required-could-not-establish-connection-receiving-end-does-not-exist/3039/9

forum.ui.vision/t/could-not-establish-connection-receiving-end-does-not-exist/6715/5

forum.ui.vision/t/recreator-required-frequent-message-could-not-establish-connection-receiving-end-does-not-exist/3137/3

The discussions there are inconclusive and recommend using xmodules instead of click events (which I am already doing) and adding a pause or wait command at various points, which I have also tried.

I have this error when trying to run this macro on both Firefox and Chrome on two different systems. Since it’s random I can’t reliably reproduce it - though I can say that I’ve never gotten the macro to run more than about 300 times. I purchase the Pro license because I have a set of over 50,000 records I need to use this one - but it’s seeming like a real waste of money at this point! I can’t be manually restarting this every couple of hundred records.

I would appreciate any advice or guidance either on this - or perhaps on requesting a refund if anyone has done that before.

I am quite sure this is fixable. First some questions about the bug itself:

  • Does the error always happen at the same point?

  • Is the command before and/or after the “command with the error” also an XClick command (= I mean, is it not a CLICK or similar Selenium IDE command?). Usually this error happens if some kind of page navigation or page load breaks the communication between extension and website.

  • Or do you use XClick | xpath= ? This “touches” the website, as it needs to locate the Xpath. If so, replacing it with XClick | image might solve the issue.

  • Last but not least, I have found that adding a small PAUSE | 2000 before the line with the error can solve it.

1 Like

And some suggestion for a potential quick workaround:

So this is some kind of loop, or? I guess it is a big CSV file that you are using as input?

If so, then you can probably use OnError: Go back to the top and try again if object not found - #2 by ulrich <= with this, the macro simply retries everything if an error happens.

If the error is not critical (with that, I mean the macro can continue after it), you can simply use store | true | !errorignore - this makes the macro ignore any error.

1 Like

Thank you! This basically solved it - along with a combo of adding pause command! It did tend to happen around the same point about 90% of the time - typically around a page load, to your point about whatever it is breaking the communication between the extension and the website.

This is something I’m running on a loop - I’m taking a clunky approach to automating processing of some records in a web application via the front end interface because it’s easier than figuring out a back end solution, so no CSV file - just a very long page of records that need to each be clicked on to open, have a few fields changed, and then closed.

Pausing for a moment and just ignoring the error was a great solution.

1 Like