It has nothing to do if the actual browser or website is open or not, because this error pops up randomly, even if theres a browser open of the website i need for the job and there is only one browser open. I even opened only one browsertab with only the website i needed. Kantu can work for a couple of minutes without a problem, and the other time it displays this error while its the exact same script. I get this error almost every day and several times a day now to the point that i cant work with it anymore because it shuts down every 30 seconds. Sometimes it is accompanied with another error that says that i have no connection while my Wifi connection is stable all the time…
So, has anyone a solution for this or is familiar with it?
This has no relevance with this bug that happens randomly, already 1 year ago I had reported this problem and continues to be there in all versions si Kantu only occurs randomly-
To decrease the chances that this error occurs, start your macros always from a web page already loaded (like google com or another site) and not from an internal browser page, so start the macros with the open command and from a tab already open with a site loadeded, it doesn’t fix the problem permanently but it will appear much less times.
At least on Chrome, by design many extensions do not work in a new tab page unless a site is already loaded.
I also noticed that when starting from a command line if I started from a batch file sometimes Chrome is backgrounded even though I had “bringBrowserToForeground” as the first step. When I switched to starting from PowerShell I never had this issue.
Hello yours are great advice but this problem randomly sometimes also appears by manually starting macros with Kantu window so it does not depend on the powershell or batch file. When it happens just open the Kantu window, select a macro, select a command and click “info for this command” this open a new tab in the browser and the problem will be solved because Kantu will check the browser again.
Okay, thanks for all the comments. The general reaction is that is a bug that is there for at least one year and that there is not much to do about it. Has it maybe something to do that when you activate a macro, you should bring the browsertab to the forefront, in other words, you cant use the computer for other tasks? Because it looks like this recudes the amount of times the error occurs.
@newuserkantu, how do i implement your solution in a code?
If you always start the macro from a tab with a website already loaded it is rarer for this bug to occur.
I start macros via batch files and randomly and rarely this flaw occurs in fact every 10 minutes I close and reopen the browser to prevent this problem.
I am dealing with this on an ongoing basis. I have a test suite that runs basically identical tests and of the seven iterations, one or two will hit this error each time I run the suite. I start the whole run from a loaded website and the first test usually runs without a hitch. Does anyone have any other ideas?
I have studied for 2 whole years to solve this problem and there is no solution, ui vision is not a program suitable to work all day continuously, ui vision sometimes crashes, the only thing you can do and a taskkill to the browser but remember that the taskkill can also damage the browser, delete files so it is an operation that should never be carried out but to solve the ui vision bug there is no other solution. Taskkill is the worst thing that can be applied to a program several times I found my browser damaged because of the taskkill but it is the only solution they recommend to close ui vision blocked.
I am encountering it daily on web pages already loaded. I will try the task kill approach on chrome and edge and see if that helps.
Update: I found a solution!!. On a given browser tab page I had a tabbed control that would change. If I simply click on the tab of the sub control then all macros return to working as expected.
@NWM and others: Do you have a macro to recreate the issue? Or, if with an internal website, maybe a screen video of it? This error is a catch-all for several different issues, not just “one” bug. So every error report is helpful.
You’re completely right, killing the process will eventually damage the files. Never do that.
You can close the browser via command line correctly which is the same as clicking X (In PowerShell):
The problem is with ui vision in stucked how you can send command to close browser ? (xrun can not work with ui vision stucked and macro code will be freezed)
Another big problem is when close the browser with external tools, what is the moment to close ?
Windows can not know ui vision stucked, how detect ui vision stucked and start powershell to close it ?
You can periodically execute the reload script with XRun which will close and restart the browser. Just do it on a time cycle quick enough before you normally see errors.