SelectWindow tab=open glitch

My macro sporadically hangs on command selectWindow tab=open. It hangs, and after a while, it retrys the command in a new tab (and error msg says “Web page connection issue. Retrying last command”). Sometimes, this clears the problem and my macro proceeds, otherwise, it hangs again and terminates with this error msg, “ipcPromise: onAsk timeout 60000 for cmd “RUN_COMMAND”, args “[object Object]””, or this error msg, “Could not establish connection. Receiving end does not exist.” I’m using Chrome. I’ve seen similar issues posted online, but no specific solutions or workarounds. Any suggestions on what I should do to trouble shoot this? Thanks in advance.

Even switching tabs with SelectWindow doesnt work.
It used to work in some older version.

Hello, do you have a test case for us?

We are currently working step by step to find and remove the remaining “manifest 3 transition” glitches. Each test case of an issue helps.

Sorry for my ignorance, but I don’t know what you mean by a test case. What is it that you want to see or have me post? My macro includes logging into an online game account with userids and passwords. Thanks.

The perfect “test case” would be a macro that we can replay on our own PCs. This way we can recreate the issue, debug it and fix it.

The second best solution (if the issue only shows on a non-public website, such as your game account) is to record a short video of it, ideally we can see the UI Vision app and the browser in the video. Sometimes we can guess from such a video what goes wrong - and fix it.

I tried to upload a test case json file but got this error msg, “Sorry, new users can not upload attachments.” My test case is a stripped down macro that attempts to repeatedly open and close a target webpage (the particular webpage that causes my macro to randomly hang during execution).

Looks like this will be an ongoing problem so with a little bit of research, I added a workaround that uses a gotoif_v2 command for !statusOK that, on error, will loop back to the selectwindow tab=open command until it successfully opens the desired tab. And also adding a selectwindow tab=CLOSEALLOTHER command keeps aborted tabs from proliferating/accumulating for each bad iteration of selectwindow tab=open.

I’ve got a similar issue (UI vision stuck after selectWindow | tab=open) and I’m very curious on how you managed to solve this using your workaround @fgn but I didn’t quite understand this from

gotoif_v2 command for !statusOK

Could you please provide some additional details?

You asked about “gotoif_v2 command for !statusOK.” It makes the macro loop back upon error and repeat selectwindow tab=open until the tab opens correctly (so that subsequent macro steps can proceed).

Here’s more about !statusOK from the UI Vision User Manual: !statusOK (read/write) contains the status of macro execution. Once an error happens !statusOK is set to “false.” !statusOK does not get reset by a successful command. Once !statusOK is set to “false” by an error, it remains “false” even if the next commands succeed. But you can use “store | true | !StatusOK” to manually reset it.

So here are the commands I’m using to workaround macro hang-ups that occur with selectwindow tab=open. It’s a brute force solution that repeats the tab=open command until it finally opens correctly. Sometimes, it will repeat NUMEROUS times, but eventually it works. Command sequence for the workaround portion (with notes):

Command: store | Target: true | Value: !errorIgnore (So that the macro continues upon error.)

Command: label | Target: On-Error-1 | Value: (Loop back to here on error.)

Command: selectWindow | Target: TAB=CLOSEALLOTHER | Value: (To close all but current tab to prevent multiple tabs from proliferating upon errors.)

Command: store | Target: true | Value: !statusOK (To reset !statusOK to no-error status.)

Command: selectWindow | Target: tab=open | Value: https://(site address)

Command: gotoIf_v2 | Target: ${!statusOK} == false | Value: On-Error-1 (To loop back on error.)

Command: store | Target: false | Value: !errorignore (To stop ignoring errors from this point forward).

Hope it works for you. I’m thinking about adding an error counter just out of curiosity to see how many times the macro loops back due to a hang up with tab=open.

I added the counter

{
  "Name": "SelectWindow tab=open",
  "CreationDate": "2022-11-1",
  "Commands": [
    {
      "Command": "store",
      "Target": "0",
      "Value": "Count",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "true",
      "Value": "!errorIgnore",
      "Description": ""
    },
    {
      "Command": "label",
      "Target": "On-Error-1",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return Number(${Count}) + 1;",
      "Value": "Count",
      "Description": ""
    },
    {
      "Command": "selectWindow",
      "Target": "TAB=CLOSEALLOTHER",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "true",
      "Value": "!statusOK",
      "Description": ""
    },
    {
      "Command": "selectWindow",
      "Target": "tab=open",
      "Value": "https://google.com",
      "Description": ""
    },
    {
      "Command": "gotoIf_v2",
      "Target": "${!statusOK} == false",
      "Value": "On-Error-1",
      "Description": ""
    },
    {
      "Command": "prompt",
      "Target": "Macro looped ${Count} times.",
      "Value": "",
      "Description": ""
    }
  ]
}

Thanks! (and gibberish to get to minimum 20 characters needed for posting)

I tried with the sequence of command, targets and values you mentioned @fgn but although it runs the macro still get’s stuck on selectWindow | tab=open, now with the number 6 instead of 2 in the extension icon in Chrome. The macro does not loop back and try again because no error is given on the selectWindow | tab=open command. Any ideas?

Here is a quick example. I am just trying to switch to the next tab with this macro, but it doesn’t work.

{
“Name”: “Next.Tab.Open”,
“CreationDate”: “2022-11-1”,
“Commands”: [
{
“Command”: “selectWindow”,
“Target”: “tab=1”,
“Value”: “”,
“Description”: “”
}
]
}

I don’t know what to tell you. When my macro loops back, it’s most often due to this error: [error][ignored] ipcPromise: onAsk timeout 12000 for cmd “RUN_COMMAND”, args “[object Object].”
Other times, when my macro hangs on selectwindow tab=open, I see this warning: “Warning #300: Web page connection issue. Retrying last command.” But here, the macro keeps retrying the last command until it successfully opens the tab so the macro can proceed. I think I have my wait time set to 10 seconds max per step so if nothing happens, the macro retries the last command after a 10 second wait.

This seems to only really be a problem when I run a macro from command line. It seems that the autostart html page used to close automatically when it finished calling the macro, but now it doesn’t and I am not sure if this changes the tab index but If I run a macro from command line that uses selectwindow tab=n that selectwindow command doesn’t work. I think this is because the tab index is thrown off but I’m not sure. Am I correct in understanding that tab 0 is which ever tab is open when the macro begins to play? It seems that because autostart html doesn’t close it becomes tab 0. But I’m not sure about this.

I run my macros from the UI Vision extension in Chrome. For me, tab 0 is the tab that I run the macro from. I don’t have much expertise with this stuff. I’m just glad I’m now able to workaround my frequent hang ups with select window tab=open.