Script Stops Working After Running A While


#1

Hi there, I’ve seen a few threads about this already but I’m not sure if this is still an issue that still exists. For my small script, it works for a little while, and then it stops working on a loop. The range of the loop and how long it takes varies very heavily and seems completely random to me.

1 automation length: ~6 seconds long
Loops: Stopped at 16 before, stopped at 250 before, stopped at 400 before, it seems pretty random to me, usually around the 10 - 20 minute mark

It’s a pretty small script that doesn’t require much “thinking” for the automation either:

{
“CreationDate”: “2018-10-29”,
“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”: “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”: “.f 4”,
“Value”: “”
},
{
“Command”: “XType”,
“Target”: “${KEY_ENTER}”,
“Value”: “”
}
]
}

Is there a reason why it stops running? How can I change or fix this? Thank you!


#2

wich command drops error?
why xclick textarea?
i would select tab and body and add error ignore so if it fails once it will run itself again


#3

I click textarea because I believe (?) that’s where the XType will type, so you need to have the Xclick for the text area so it knows where to type. I might be wrong though!

There’s no error that pops up, it just stops working. I’ll run again and I’ll attach screenshot when I get chance!

Thank you for your help!


#4

I tested a similar macro for several hours, and all worked ok (Kantu for Chrome, Win 10)

There was an “IPC issue” in the past but that is solved. That said, a few other users also reported a “it stops sometimes” problem - but we can not recreate it yet.

So if you or anyone else can share a complete macro that shows the “stop issue” that will be great.


#5

That was the exact macro I used and it stopped working. Here’s what the screen looks like:

It stays there, and the program stops executing. If it helps maybe I can record the whole process happening?

Thanks!


#6

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.


#7

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!


#8

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.


#9

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.


#10

Thanks for the additional details. But what popup?


#11

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.


#12

Any news on why this happens or still a mystery?


#13

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.


#14

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.


#15

@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.)


#16

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.


#17

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.


#18

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:


#19

Ok, thanks for the info. Then “your bug” seems to be the same as this one: Pausing (stopping) Issue - 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:


#20

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!