Script Stops Working After Running A While

Oh I actually used a different macro but a similar one to that, but the way it stops executing is in the exact same fashion.

Seems to be always happening on the first command of the loop - either it’s the XClick command (which I don’t think so) or it’s because it’s placed on top of the loop

Oh and, is it possible to still go through with the loops after the macro timeouts so I can still make it run even if it unexpectedly pauses like that? Thank you!

About the error: This is very strange… if you can send us a macro to test, we would love to debug this further.

As a workaround, consider running the macros via the command line, here is a powershell example that waits for the macro to complete. Since it always opens and closes Chrome, such a sequence will be able to run “forever” without issues.

Sorry what do you mean by macro? Just sending you the source code or is there a better way to do it?

{
“CreationDate”: “2018-11-1”,
“Commands”: [
{
“Command”: “XClick”,
“Target”: “//[@id="app-mount"]/div[1]/div/div[1]/div/div/div[2]/div[2]/div[2]/div[2]/div[1]/form/div/div/textarea",
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “.s”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “${KEY_ENTER}”,
“Value”: “”
},
{
“Command”: “visualSearch”,
“Target”: “ZqGwAi_dpi_120.png”,
“Value”: “count”
},
{
“Command”: “if”,
“Target”: “${count} > 0”,
“Value”: “”
},
{
“Command”: “XClick”,
“Target”: "//
[@id="app-mount"]/div[1]/div/div[1]/div/div/div[2]/div[2]/div[2]/div[2]/div[1]/form/div/div/textarea”,
“Value”: “”
},
{
“Command”: “pause”,
“Target”: “2000”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “.c 9”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “${KEY_ENTER}”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “.c 11”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “${KEY_ENTER}”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “.c 11”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “${KEY_ENTER}”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “.c 11”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “${KEY_ENTER}”,
“Value”: “”
},
{
“Command”: “endif”,
“Target”: “”,
“Value”: “”
}
]
}

This is the source code if that’s what you mean, if you require something else please let me know. I run it on discord.com, it can run on any channel basically. If this matters, I do not have admin rights on my computer account, and this popup has happened to me multiple times on multiple codes, so it may be a computer thing?? Not quite too sure at the moment.

If you need anything else please let me know! Thank you!

Oh and the code I posted above as the topic creator also creates this error for me, I don’t know why it doesn’t for you, it might be easier to test it because I have a visual image thing on this one. This is making me believe that it might have something to do with the computer more so than the code itself.

Thanks for the additional details. But what popup?

Sorry bad wording on my part. There’s no popup, I mean this error happens where it just stops doing anything with no popup, and it just eventually times out as I set the macro length to 2000 per loop. The time of the error is very inconsistent and doesnt seem to have a pattern, sometimes it goes to 400 loops and sometimes it goes to 3000 loops etc, doesn’t seem to have a definite number to that.

Any news on why this happens or still a mystery?

We were able to recreate this issue, it seems to be an issue with the Windows message queue. It does not happen on Mac or Linux.

Currently we are debugging this to fix it.

“Workaround”: If this is the same issue that we are seeing, then moving the mouse manually a little bit should make the macro continue. Of course, that is no real solution… but can you test if this works for you? This way we can be sure we are seeing the same issue.

This issue only happens if XClick and XMove are used.

1 Like

No it’s not! The forum has plenty messages of the case. Has nothing to do with XCommand.
How ever it can have relation to mouse movement. It is less likely to happen (for me) when computer is in use.

1 Like

@commensal: Well, I should clarify: There is one issue that we can recreate, and it is related to the real user simulation and this might be the case for what @Legoego sees.

This is clearly not the same issue as “kantu stops after 300-1000 loops” (e. g. here or here) which we still have a very hard time recreating. (For this issue, I would be happy to give someone access to a Windows or Linux machine to recreate something testable for us.)

I have reported the issue for much less loops that you stated (3-10).
I don’t think the issue is with loops by itselfs.
I’m interested in finding the cause but realistically how do you think this can be achieved?
There is no debug log to my knowledge and the usual log is completely useless for the matter.
I do stuck upon the issue quite often and could report valuable info given tool to collect it.

Our plan for this bug are:

(1) Ideally we get/find a test case that we run and debug locally.

(2) If not, we will have to develop a tool to collect technical debug info. For now, we hope we find a good test case since development is busy with some other features. But if needed, we will do this tool. We all here agree, this bug must be found and fixed.

No, I don’t think this is the same bug, sorry. Even if I move manually with my mouse, the script still doesn’t work :frowning:

Ok, thanks for the info. Then “your bug” seems to be the same as this one: [Issue #513] Pausing (stopping) Issue - #8 by alvaro10 - Bug Reports - UI.Vision RPA Software Forum | Discuss RPA Automation, Selenium IDE and OCR API Text Recognition - for which we are still looking for a good test case. But the bug itself has very high prio - it comes up so often in the forum lately :frowning:

Instead of find a good test cause, is it possible to make an option just to reset the loop if the macro times out? I feel like that might be easier and be a good short term solution instead of needing to go to cmd line, and it’ll help out a lot. Thanks!

1 Like

I should say that I also get this error constantly. The macro freezes, but works when I pause then play. I can’t share the code though, because it access pages behind passwords

1 Like

Under the Windows operating system, I also encountered the same problem.

We continue to investigate this issue. The next update will include a fix that hopefully solves it.

But note that for reliable 24/7 operation with Kantu we recommend that you use the command line. With the command line you will get an error message if this issue happens, and can restart your macro.

Hi - I am running a loop that opens a new web page in each iteration and saves it as a “.html” file by replacing the default name with my given name using the XType command.

However, every few iterations (about 5 or so), the second XType command stops working so that the save window stays on the screen with the default name while the loop continues to load new web pages.

The code I am using is as follows:

{
“Command”: “XType”,
“Target”: “${KEY_CTRL+KEY_S}”,
“Value”: “”
},

Below is where the XType command stops working while the loop continues to work by loading new web pages.

{
  "Command": "XType",
  "Target": "MY_GIVEN_NAME_${!LOOP}",
  "Value": ""
},
  {
  "Command": "XType",
  "Target": "${KEY_ENTER}",
  "Value": ""
},

Guys, total noob here but I’ve been plagued with this problem and found a workaround that might work for you too. Ready?

Add a comment line somewhere in your code.

You’re welcome