Error at closing tabs

Hello i’m trying to run a macro with the google chrome plugin Kantu. I have the latest version of Kantu (5.2.3) and Google Chrome ( 77.0.3865.90 ).

Sometimes I have errors while at other moments it just works. For instance after I start with opening an url, clicking some pages, then closing the current and other tabs (there aren’t any others, but I just want to close the browser window). Then I open a page again which works, but then asking to close all other tabs, it throws an error. Is there a way to just close the browser? I close all other tabs as well in case there is another tab openend.

Log file:
[info] Executing: | open | | |

[info] Executing: | selectWindow | TAB=CLOSEALLOTHER | |
[info] Executing: | selectWindow | TAB=CLOSE | |
[info] Executing: | pause | 1000 | |
comment | Open macrosucces.php | |
[info] Executing: | open | http://localhost/macrosucces.php | |
[info] Executing: | pause | 1000 | |
[info] Executing: | selectWindow | TAB=CLOSEALLOTHER | |
[status] onError - about to goto label ‘ERRORLABEL’
[error][ignored] Error #101: Kantu is not connected to a browser tab

Can you help me out on this one? Thanks!

Hi

It’s possible because you use NON web site url.

Sometimes in this case kantu give this error “Kantu is not connected to a browser tab”

That sounds pretty weird… I removed the closeallother because there are no other tabs open. So no problem with that. Yet I would like to know if there is a line of code to just close the browser window.

Yes

I close my browser with this code (require xmodules installed)

{
  "Name": "Close_Browser",
  "CreationDate": "2019-10-15",
  "Commands": [
    {
      "Command": "store",
      "Target": "true",
      "Value": "!ERRORIGNORE"
    },
    {
      "Command": "bringBrowserToForeground",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "Browser Will Be Closed Now",
      "Value": "#shownotification"
    },
    {
      "Command": "selectWindow",
      "Target": "TAB=0",
      "Value": ""
    },
    {
      "Command": "selectWindow",
      "Target": "TAB=CLOSEALLOTHER",
      "Value": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_CTRL+KEY_W}",
      "Value": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_CTRL+KEY_W}",
      "Value": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_CTRL+KEY_W}",
      "Value": ""
    }
  ]
}
1 Like