[Bug] [Issue #409] Lost background heart beat when running command

Yeah, just saw this error as well today; running 3.1.9. 355 line macro

Do you guys use other browser at the same time the script is running or watch videos(youtube etc. or in an app)?
I figured if I leave the laptop alone I do not stuck upon this error. But I stuck on freezing without any error written to log.
And I can’t figure out if this is the same error with a little different indication or not.

Hi,

I am using it in a browser by itself. Nothing else running on the computer!

N

Just looked in the extensions errors console and saw

console.error(chrome.runtime.lastError.message + ', ’ + method + ', ’ + JSON.stringify(args));

I consistently get this error when using the “type” or “sendKeys” command with a textarea, when the value to type is very long (10,000+)
I am then using the following:

{
  "Command": "storeEval",
  "Target": "\"\\n50,000 extra chars:\\n\" + (new Array(1001).join(\"xyzab1234567890 xyzab1234567890 xyzab1234567890X,\\n\"))",
  "Value": "value50kCharacters"
},
{
  "Command": "type",
  "Target": "id=memo_field",
  "Value": "${value50kCharacters}"
},

HW specs: Macbook pro 2018; chrome 70.0; Kantu browser automation 3.3.3
Hope this helps in resolving it!

Hi @paulklinkenberg - this is a good test case, thanks!

I am facing this issue too in the lastest version, I have started yesterday then when come today show round 1/99 means don’t even completed the first loop ? (was stuck in open a page)

Google Chrome Version 71.0.3578.80 (Official Build) (32-bit)
Kantu 3.5.5

There is any option to enable datetime in the kantu logs history ?

thanks

@novo what kind of macro did you run? The test case from @paulklinkenberg turned out to be too artificial for debugging, as it freezes the web page. So we are still in search for a good use case that allows us to recreate and debug the “stop” use case.

If you need to run macros or test suites 24/7 the best solution is to use the Kantu command line - we have a good Powershell and (soon) Python example. Chrome and Firefox itself are not designed for 24/7 operation. So even without the “Lost background heart beat” bug, the browsers will react strange after several hours of non-stop automated web browsing. This happens with every automation solution, including Selenium Web Driver. That is why our Powershell script checks for a non-responsive browser and kills Chrome if needed.

I am just started using Kantu, so I am not have many experience yet.

But here just testing with to open a page then go to google and wait 2 hours (PAUSE 7200000) then open again the same page. (just for testing purpose because I don’t know yet how to do it with if/else )

I can see with Opera running more stable I think the same script running already 12/99 rounds.
But I do understand then to leave the script running 24/7 need to using command line stuff I will learn first the basics then I can try. thanks

I have running with linux machine and got this behavior too there is any example like powershell to shell script ? to check the browser ?

Maybe this helps? Powershell and Python command line example

1 Like

I have the same problem too.
Chrome Version 71.0.3578.98 (Official Build) (64-bit)
Kantu 3.7.2
The script has 32 commands; 166 lines in JSON
Let me know if you want the full script to run it on your side.

@ptalbot Yes, if we can run the script that would be great.

Here’s the script

{
“Name”: “SAQ_Search_Bing_Rouge_Page”,
“CreationDate”: “2019-1-12”,
“Commands”: [
{
“Command”: “store”,
“Target”: “0”,
“Value”: “loop_counter”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!ErrorIgnore”
},
{
“Command”: “store”,
“Target”: “FAST”,
“Value”: “!replayspeed”
},
{
“Command”: “store”,
“Target”: “2000”,
“Value”: “!TIMEOUT_MACRO”
},
{
“Command”: “store”,
“Target”: “0”,
“Value”: “no_result”
},
{
“Command”: “while”,
“Target”: “${!statusOK}”,
“Value”: “”
},
{
“Command”: “storeEval”,
“Target”: “(${loop_counter} * 10) + 1”,
“Value”: “page_index”
},
{
“Command”: “echo”,
“Target”: “loop_counter ${loop_counter}”,
“Value”: “”
},
{
“Command”: “open”,
“Target”: “"cote des experts"+"Fiche produit"+"vin rouge"+-"Ce produit est épuisé"+-"pas en stock " site:www.saq.com - Search”,
“Value”: “”
},
{
“Command”: “storeAttribute”,
“Target”: “//[@id="b_results"]/li/div/h2/a@href",
“Value”: “!csvLine”
},
{
“Command”: “csvSave”,
“Target”: “saq_save_rouge”,
“Value”: “”
},
{
“Command”: “storeAttribute”,
“Target”: "//
[@id="b_results"]/li[2]/div/h2/a@href”,
“Value”: “!csvLine”
},
{
“Command”: “csvSave”,
“Target”: “saq_save_rouge”,
“Value”: “”
},
{
“Command”: “storeAttribute”,
“Target”: “//[@id="b_results"]/li[3]/div/h2/a@href",
“Value”: “!csvLine”
},
{
“Command”: “csvSave”,
“Target”: “saq_save_rouge”,
“Value”: “”
},
{
“Command”: “storeAttribute”,
“Target”: "//
[@id="b_results"]/li[4]/div/h2/a@href”,
“Value”: “!csvLine”
},
{
“Command”: “csvSave”,
“Target”: “saq_save_rouge”,
“Value”: “”
},
{
“Command”: “storeAttribute”,
“Target”: “//[@id="b_results"]/li[5]/div/h2/a@href",
“Value”: “!csvLine”
},
{
“Command”: “csvSave”,
“Target”: “saq_save_rouge”,
“Value”: “”
},
{
“Command”: “storeAttribute”,
“Target”: "//
[@id="b_results"]/li[6]/div/h2/a@href”,
“Value”: “!csvLine”
},
{
“Command”: “csvSave”,
“Target”: “saq_save_rouge”,
“Value”: “”
},
{
“Command”: “storeAttribute”,
“Target”: “//[@id="b_results"]/li[7]/div/h2/a@href",
“Value”: “!csvLine”
},
{
“Command”: “csvSave”,
“Target”: “saq_save_rouge”,
“Value”: “”
},
{
“Command”: “storeAttribute”,
“Target”: "//
[@id="b_results"]/li[8]/div/h2/a@href”,
“Value”: “!csvLine”
},
{
“Command”: “csvSave”,
“Target”: “saq_save_rouge”,
“Value”: “”
},
{
“Command”: “storeAttribute”,
“Target”: “//[@id="b_results"]/li[9]/div/h2/a@href",
“Value”: “!csvLine”
},
{
“Command”: “csvSave”,
“Target”: “saq_save_rouge”,
“Value”: “”
},
{
“Command”: “storeAttribute”,
“Target”: "//
[@id="b_results"]/li[10]/div/h2/a@href”,
“Value”: “!csvLine”
},
{
“Command”: “csvSave”,
“Target”: “saq_save_rouge”,
“Value”: “”
},
{
“Command”: “storeEval”,
“Target”: “${loop_counter} + 1”,
“Value”: “loop_counter”
},
{
“Command”: “endWhile”,
“Target”: “”,
“Value”: “”
},
{
“Command”: “localStorageExport”,
“Target”: “saq_save_rouge.csv”,
“Value”: “”
}
]
}Preformatted text

@ptalbot Thanks. Please also add the code tags, otherwise the code is difficult to copy.

I ran into this error too.
The script has 12 commands and the first one is the open-command that brought forth the error for me. :’)
It should be noted that I also tried running a different scrip (an earlier version of the current one, which ran just fine earlier without encountering the error) after encountering this error with my current one, and the error occurred then too.

Actually I just restarted my computer and ran the scripts (which earlier had given me the error) and they worked just fine about 5 minutes ago when I first posted this comment… except now when I try to run them I get the error again. :face_with_raised_eyebrow:

But the best and rock-solid way for automation that runs for days, weeks and months without interruption is ti use the command line and check the return codes of Kantu, see UI Automation Open-Source Selenium IDE plus additional features, iMacros alternative

Hi @admin

Today kantu show this error “lost background heart beat when running command” this is caused when open a site but the site do not load or connection internet lost.

Need to optimizate the case with connection lost and kantu can not load the page with open command because In this case Kantu rest stucked.

Have a nice day

1 Like

same error today. (21/11/2023) :upside_down_face:

Do you see this issue with V9.0.1, too? If so, a test case would be helpful.