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:
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?
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.
@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!
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.
@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!
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:
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¯o=F1-saleCheckF01.json --profile-directory="Profile 12"'
but it’s this: '"file:///G:/My Drive/uivision/ui.vision.html?direct=1¯o=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.
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?
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.