Could not establish connection. Receiving end does not exist - occurs frequently with selectWindow

Hi have a macro that I am trying to run many times, but unfortunately I quickly run into an error. It is a very simple macro that basically just copies something from one tab, then opens a new tab with what is copied as the URL, and then perform some actions.

I have another longer macro that is also causing the same issues so I’m not looking to read from a CSV instead. But how do I solve it?

I have seen other link that suggesting adding pause, which I have done.
I don’t want to ignore the error and continue the loop
How would I use OnError in this scenario?

I find it strange that both of my macros that use selectWindow have the same problem. Is there a bug?

Code of the simple macro is below. I haven’t included my complex macro as that is huge:

Error occurs on line 4:

[error]
Line 4: Could not establish connection. Receiving end does not exist.
[info]
Macro failed (Runtime 639.92s)
{
  "Name": "check",
  "CreationDate": "2022-10-22",
  "Commands": [
    {
      "Command": "bringBrowserToForeground",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_CMD+KEY_C}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "2000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "selectWindow",
      "Target": "tab=open",
      "Value": "${!clipboard}",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "1000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "sourceSearch",
      "Target": "*\"pageType\":18*",
      "Value": "publicprofile",
      "Description": ""
    },
    {
      "Command": "selectWindow",
      "Target": "tab=close",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_LEFT}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "if_v2",
      "Target": "${publicprofile}==1",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "Public",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "1000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_ENTER}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_RIGHT}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "else",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "Not",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "1000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_ENTER}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_RIGHT}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    }
  ]
}

Hi, thanks for the test case. Just to clarify:

  • Can you please post a video of the macro running? I want to make sure I do the same thing when I test it. What is inside the clipboard? Any URL? => Do you get the error also if you use e. g. https://ui.vision as URL?

  • So the issue happens frequently, but not always, correct?

This issue has been happening for a long time now (perhaps a couple years?), and despite lots of reports and examples, may I ask what makes it so difficult to tackle?

Finding a reliable test case/test macro that we can run and debug :wink:

You may have noticed, whenever we do manage to get a good test case the issue is usually fixed within a few weeks. Latest example: The “#180 error” bug. It took us months (and many forum posts from users proving details) to be able to find a test case that shows the issue whenever it is run. Then we can debug.

So if the macro from @sharkman recreates the bug reliably, a fix will be made soon.