No tab with id solution

@admin

I have several unattended macros that are triggered via task scheduler that start with chrome not already open and noticed a recent increase (over 50% of the time) getting the No tab with id: xx error like shown below:

Screenshot 2020-10-02 085439

After a lot of testing I found out that the error doesn’t happen when chrome is already loaded or if my script loads chrome first, pauses for it to load, then starts UIVision and the macro.

If I remove the pause in the script the error comes back. I’m not sure why but a pause in the beginning of the macro itself doesn’t help, it has to be before UI.Vision is even called.

If anyone is getting this error with this specific scenario try the loading pause to see if it helps.

Maybe a pause needs to be hardcoded in UI.Vision before it tries to communicate with Chrome?

@User9898

I’ve had this problem in the past using the command line (batch file) with continueInLastUsedTab-0/1 option since I no longer use this option it’s resolved and I haven’t noticed this bug anymore,

@User9898 I’m seeing this error, as you said when chrome is taking a bit longer to load I observe this issue. Between could you please let me know how are you adding loading pause as you mentioned?
I added a pause before and after calling UI vision macro proc through command line api in my python script but it did not help much.

I am just loading chrome, pausing, then calling the macro.

PowerShell:
Start-Process “C:\Program Files (x86)\Google\Chrome\Application\chrome.exe”
Start-Sleep -Seconds 8
Start-Process “C:\Program Files (x86)\Google\Chrome\Application\chrome.exe” “file:///C:/Users/Path//UIVision/ ……”

Batch:
“C:\Program Files (x86)\Google\Chrome\Application\chrome.exe”
timeout 8
“C:\Program Files (x86)\Google\Chrome\Application\chrome.exe” “file:///C:/Users/Path//UIVision/ ……”

I’m not familiar with Python

Is there a solution for this problem? @admin

@User9898 Could I ask how do you add the loading pause before UI.Vision called? I don’t know how to do that, so this no tab with id error happens to me all the time.
Please help me with that, thanks!

1 Like

You can do this with a script in any language. All it does is the same as opening the browser, doing nothing for x seconds, then starting the UI.Vision macro. The pause allows the browser to fully load, configure, and settle so it’s not a high processor load like when initially started.

Here are some examples: RPA/command-line at master · A9T9/RPA · GitHub

1 Like

@User9898 thank you, but I still don’t know how to put this into Task Scheduler, all I know is to set Task Scheduler to open UI Vision and run the script.

Or is there a way to use cmd or power shell, so I can open UI Vision at a specific time just like Task Scheduler? Please help me with that, thank you!

Still use task scheduler but instead of it starting chrome directly it just starts a small script. For example you could do something like:

Start-Process "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"

Start-Sleep -Seconds 60

Start-Process "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "file:///C:/Users/Path/MyAutostartHTMLpage.html?direct=1&storage=xfile&closeBrowser=1&macro=YourMacro" 

Save as a .ps1 and now task scheduler just starts the PowerShell script which starts chrome, waits 60 seconds, then starts the macro.

In task scheduler you’ll be starting a program - either powershell.exe (Windows PowerShell) or pwsh.exe (PowerShell). The path to the script goes in the arguments section like:

-NoProfile "C:\Users\Path\YourScript.ps1"

@User9898 I have tried this but I keep receiving this error:

I only try in Powershell (not with Task Scheduler yet) but it won’t open UI Vision. All it did is open the Chrome Profile and it’s the end.

Here is my script, please tell me how to fix it:

Start-Process -FilePath "C:\Program Files\Google\Chrome\Application\chrome.exe" '--profile-directory="Profile 12"'


Start-Sleep -Seconds 10


Start-Process -FilePath "C:\Program Files\Google\Chrome\Application\chrome.exe" '--profile-directory="Profile 12"' "file:///G:/My Drive/uivision/ui.vision.html?direct=1&macro=F1-saleCheckF01.json" 

Ok try this:

Start-Process -FilePath "C:\Program Files\Google\Chrome\Application\chrome.exe" -ArgumentList 'file:///G:/My Drive/uivision/ui.vision.html?direct=1&macro=F1-saleCheckF01.json --profile-directory="Profile 12"'

There can only be one argument list and the profile has to be in double quotes so the whole argument list needs to be in single quotes

Thank you @User9898, I have to change it a bit, but it works.
it’s not this:
'file:///G:/My Drive/uivision/ui.vision.html?direct=1&macro=F1-saleCheckF01.json --profile-directory="Profile 12"'
but it’s this:
'"file:///G:/My Drive/uivision/ui.vision.html?direct=1&macro=F1-saleCheckF01.json" --profile-directory="Profile 12"'

I want to ask one more thing. Because I have to run it with Profile 12, so the argument in running powershell should be like this?
--profile-directory="Profile 12 "C:\Users\Path\YourScript.ps1"

I tried this but it didn’t run. I also try only "C:\Users\Path\YourScript.ps1" but it didn’t, either. What do you think about this?

Edited: Nevermind, I tried -File "C:\Users\Path\YourScript.ps1" and it works! Thank you so much for your help.

Oops sorry I forgot the quotes around the file. Glad you got it working.

1 Like

So sorry to break this down to you, but even when I did this, the error No tab with id is still with me.
I don’t know if it’s because I run it several time per day (10 times, and I don’t think this is a high number), or it’s because of something else?

Is your macro running in a loop and on v6.3.2? If so a memory leak has recently been discovered: Ui.Vision RPA Chrome extension: Migration from Manifest V2 to Manifest V3 [Completed 😃] - #20 by admin

Have you tried if you have this issue in v6.2.8?

I’m using V6.2.8, since V6.3.x has been killing me in the past few days.

Do you have bringBrowserToForeground at the beginning of the macro?

It doesn’t matter since I run it in a VPS and don’t have any screen on. So those kind of command, and XModules command would not run unless I open the VPS by a screen. My macro is full of not-that-kind of command, so it would run fine when in background.

The matter, I think, is that UI Vision can’t access a single Chrome tab to execute the macro. It doesn’t even run the first command, so I don’t think put bringBrowserToForeground at the beginning would make any different. But I’ll try that. Thanks for you support.