No tab with id error when running macros from command line

Hello all. So I am having a bit of an issue when trying to run an exported macro from the command line. I want to preface this post be stating that the exact same macro, when run directly from the “UI.Vision RPA” window, runs as expected. I have Google Chrome open to the tab I want the macro to run in (note I have many tabs open in google chrome), but the issue that I am running into has to do with the fact that the command line opens a new tab in google chrome. Just so you all know ahead of time, I have read the command line documentation pretty extensively, and I did see that there is a depreciated command line argument (continueInLastUsedTab) which explains that the default behavior of the macro is to run in the tab where the last macro ran. This makes sense, as the tab which is opened when the macro is run does automatically close. However, attempting to run an exported macro from the command line results in the “UI.Vision RPA” window which pops up:

Furthermore, when looking at the browser after the macro fails, the tab that the macro was supposed to run on is not the tab that is active in the browser. The tab that is active is the one that is farthest right, which tells me that, when the new tab that the macro creates closes, the browser is making the tab that was next to the closed tab the active tab. I am not sure what is causing this, but any information would be great.

image

I solved this same issue by starting chrome only and then pausing for 15 seconds (more if you have a lot of tabs loading on start), then starting the macro.

The pause needs to be in your script, not the macro.

@User9898 What do you mean by “start chrome only?” Can the macro run on an already open chrome window?

Meaning start chrome by itself. I have a PowerShell & Batch example here:

@User9898 So the example you gave does not answer my other question: is it possible to do this with an existing window? The automation I am trying to create is going to be very difficult if I have to launch a new instance of chrome. It would be much easier if I can use a tab that I already have open. Furthermore, the documentation states that macros should be able to run in browsers that are already running should be possible to use existing tabs, I am not really looking for a workaround. This is meant to act as a bug report. If the product is not working as designed, then it should be fixed. I wonder what @TechSupport thinks about the issue?

Yes but it’s very hard.

You must save the macro like bookmarkes and after with external software you must run the bookmarks with Google Chrome opened and it run the macro in browser opened.

But it is not easy to do this.

Here discussion to save keys combination to run bookmarkes of ui vision

To click keys combination some user use autohotkey software.

In my opinion command line of ui vision works bad, usually random give errors, if you run 1000 times macro you can see bug and errors, is not stable ui vision for this type of work because require a large amount of resources when browser start up.

To use specific tabs you can use the selectWindow command: selectWindow, select Window - Selenium IDE Commands Tutorial

I sometimes see this error when I start a macro from bookmarkers and it seems that it shows a random ID.

I remember that ID 36 appeared to me but it doesn’t make much sense, I think it’s an error due to the partial loading of some instruction to start the macro via command line or via bookmarkers.