Tab not found and connection lost 'Error #101: Kantu is not connected to a browser tab '

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.

A totally solution to solve i do not find.

kantunotconnected

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?

This is a whole rule of the macro, this script creates a category a website:

{
“Name”: “started”,
“CreationDate”: “2019-11-14”,
“Commands”: [
{
“Command”: “open”,
“Target”: “https://app.luondo.nl/account/products/categories”,
“Value”: " "
},
{
“Command”: “clickAndWait”,
“Target”: “link=Opzetzwembaden”,
“Value”: " "
},
{
“Command”: “click”,
“Target”: “xpath=//[@id="lmtabs_myTab_1"]/div[1]/div/div[2]/div/button/span[1]",
“Value”: " "
},
{
“Command”: “click”,
“Target”: “link=Speelgoed”,
“Value”: " "
},
{
“Command”: “click”,
“Target”: "xpath=//
[@id="save-button-container"]/button”,
“Value”: " "
},

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.

Your macro code is correct and should work well.

Okay, thanks for the feedback!

If you always start the macro from a tab with a website already loaded it is rarer for this bug to occur.

Actually, it should never occur in this case :slight_smile:

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.

1 Like

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):

Get-Process -Name chrome | ForEach-Object { $_.CloseMainWindow() }

You can also send an alt space + c to close correctly.

1 Like

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.

You can also watch for the browser not responding: The best way to open and close automatically at a specified time to prevent memory leaks(VBscript) - #3 by Plankton

Thank you for the support. I am happy to report I was able to find a solution.

What solution did you use?

I just switched to a different browser tab (or opened a new one) and then switched back to the original tab that I wanted to work on. So far, it has worked everytime and gotten rid of that dreaded error about not being connected to a browser tab.

1 Like

Please see Error #101 Solution