Error: Could not establish connection. Receiving end does not exist. while executing the macro through command line

Error: Could not establish connection. Receiving end does not exist. while executing the macro through command line

When do you see this error? Do you always get it, or “only” sometimes?

@admin I have recently started using UI.Vision as a replacement for Power Automate, as it’s a lot better than the MS product but I too am expeiencingt this issue, specifically with regards to running a macro from the CLI and I wondered if I should create a new post as this is an old one, or should we continue with this thread to avoid duplication?

Either way here’s my scenario.
I have several Macros that I run ever 5 minutes at 10 second intervals to do some basic website tasks, this is executed by Windows Task scheduler that is triggered according to a schedule. The task scheduler then executes a .cmd file that runs a powershell script to open the macro using the autorun HTML generated for each macro.
The error I encounter [UI.Vision RPA] Could not establish connection. Receiving end does not exist. doesn’t occur on every execution but intermittently and then snowballs and I’m left with 10s of open tabs for each CLI execution until I clear them and recheck the manual execution of the macro, then it runs fine again for a while until the next error.

Hmm, we haven’t seen this issue in a while. So I have a few questions:

  • Do you run web automation or desktop automation?

  • I assume it is web automation. If so, do you also see the error if you run a simply macro like “Demo-Autofill”?

  • Or, as a test, add an OPEN | https://google.com/ at the top of your macro. Does this avoid the error? (My guess for the reason of this issue is that you load a complex website that blocks the web browser for a while, so it is unresponsive, and thus Ui.Vision can not connect to the tab.)

Thanks for replying, my answers are:

  • This is Web automation using the Chrome extension
  • There is no error when running the macro from within the extension itself
  • Adding the OPEN statement to the beginning off the macro did open the Google page for that macro, then the next macro ran successfully, but macro 3 and 4 both failed.

All of my macros start with the following

{
      "Command": "store",
      "Target": "fast",
      "Value": "!replayspeed",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "3",
      "Value": "!TIMEOUT_WAIT",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "60",
      "Value": "!TIMEOUT_PAGELOAD",
      "Description": ""
    },
    {
      "Command": "selectWindow",
      "Target": "title=TabTitle",
      "Value": "",
      "Description": ""
    },

I have removed the suggested OPEN statement and re-run the macro successfully from the CLI

And now the macros are running through one after another with no error.

So all works now?

In general,you should have at least in the first macro an OPEN statement so that a normal website is loaded.

Nope, they’re still failing intermittently, sometimes they run through fine for hours and some times they don’t even start up for ages.
The site I want to interact with is already open, that’s why I do a selectWindow.
I’ve added a Open statement first for each macro and will monitor and report back.

After adding the Open statement the macros still didn’t run but when I manually ran them the open statement replaced the site page in the active tab with the site in the target, not ideal.
I have now removed the Open statement.

Touch wood all macros seem to be running fine today after Chrome relaunched for an update

If this happens again, can you record a video of the situation? Maybe this can give us an idea what triggers that problem.

I have recorded a video but ideally don’t want to upload it where it is publicly viewable, can we pick this up in a DM?

@admin after taking a longer look at this I’m starting to think it’s more to do with the scheduling and execution of the macro rather than the macro or UI extension. I noticed some command windows tasks being stuck in the Task manager
My process is as follows:

  1. Windows Scheduler triggers at scheduled time:
  2. Scheduled tasks executes a .cmd file
  3. The cmd file sets PowerShell ExecutionPolicy and runs a command to launch the macro Autostart page as follows [system.Diagnostics.Process]::Start("chrome","file:///C:/Users/user/Downloads/start-macro.html")

I have re-addressed this so that the Task scheduler now executes the PowerShell .ps1 script itself and it’s working but I will monitor and report back any findings

This hasn’t resolved the issue