A9T9 / RPA

UI.Vision: Open-Source RPA Software (formerly Kantu) - Modern Robotic Process Automation with Selenium IDE++
https://ui.vision/rpa
Other
1.18k stars 283 forks source link

Execution of commands stops #35

Closed roboserg closed 5 years ago

roboserg commented 6 years ago

Basically the console says "[info] Executing: | pause | 9000 | | " and it just doesn't do anything. Same happens with other commands like "open" and others. The IDE itself works and is not frozen, its just the execution of the command stops. See pictures below:

https://puu.sh/zz2k2/094ef31e88.png https://puu.sh/zz2oz/525f964c13.png https://puu.sh/zz2p2/dd6026b9f7.png

!TIMEOUT_WAIT is set to 10, nothing happens after 10 seconds, it just gets stuck.

Using win10 64 bit, latest chrome and IDE plug in.

ps. it doesnt happen for ALL commands, sometimes the steps work, sometimes they dont. Really weird and smells like a bug.

A9T9 commented 6 years ago

Strange... can you please post a test macro here? Or does it even happen with our demo macros?

Laminar72 commented 6 years ago

I've got the same problem. What I found out it stucks on a webpage where we included an Google Map with iframe. If I replace this page (Iframe/Map) with any other, it runns smoothly.

{
  "CreationDate": "2018-3-29",
  "Commands": [
    {
      "Command": "store",
      "Target": "true",
      "Value": "!errorignore"
    },
    {
      "Command": "while",
      "Target": "(1>0)",
      "Value": ""
    },
    {
      "Command": "open",
      "Target": "https://wetter.rega.ch/anetz/default.asp",  <--------- iFrame GoogleMap
      "Value": ""
    },
    {
      "Command": "pause",
      "Target": "5000",
      "Value": ""
    },
    {
      "Command": "open",
      "Target": "https://wetter.rega.ch/radarbilder/radarbilder_06_film.asp",
      "Value": ""
    },
    {
      "Command": "pause",
      "Target": "5000",
      "Value": ""
    },
    {
      "Command": "open",
      "Target": "https://wetter.rega.ch/kamerabilder/kamerabilder.asp?aktion=Details&id=58",
      "Value": ""
    },
    {
      "Command": "pause",
      "Target": "5000",
      "Value": ""
    },
    {
      "Command": "endWhile",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "",
      "Target": "",
      "Value": ""
    }
  ]
}

Log [status] Playing macro WetterRegaEinsatzleitung [info] Executing: | store | true | !errorignore | [info] Executing: | while | (1>0) | | [info] Executing: | open | https://wetter.rega.ch/anetz/default.asp | | [info] Executing: | pause | 5000 | |

Laminar72 commented 6 years ago

Sometimes it works Here an Update. While pausing it falls into a timeout?!

[info] Executing: | open | https://wetter.rega.ch/anetz/default.asp | | [info] Executing: | pause | 7000 | | [error] macro timeout 900s (change the value in the settings if needed) [info] Macro failed (Runtime 989.87s)

Laminar72 commented 6 years ago

It is not the iframe nor the google map itself. It's probably how the site / google maps api is being used. If I include the specific website (GoogleMap with layers) without iframe it stucks too If I include a standard google map it works. Is there a way to get debug information out of kantu? Why it stucks?

A9T9 commented 6 years ago

Closing for now. Please reopen if there is a test case.

Laminar72 commented 6 years ago

I can for sure reproduce that problem with an internal webapplication using google maps. If you give me any info how to record information for you, let me know. Otherwise it is, a bit disappointing not to get any feedback on any feedback or info I'm giving and just close the thread.

A9T9 commented 6 years ago

Sorry. I am sure the bug is there, but we need something on a website that we can debug. Can you find a similar public website?

That said, did you try with the latest 2.7.3? It has many bugfixes, maybe we fixed this bug by chance?

PatrickBorkowicz commented 6 years ago

I will echo that. I've had execution freeze when running a loop on a "pause" action and also a "waitForPageToLoad" action. For example the pause will count up to 16s of 30s and just freeze. Pausing and resuming the macro continues execution just fine. Same for "waitForPageToLoad". I believe I am on the latest version as of this post.

A9T9 commented 6 years ago

Patrick, do you have some sample code for us that shows the issue? You can post the JSON from the "Json tab" directly here.

PatrickBorkowicz commented 6 years ago

Sure. This macro iterates though URLs to a content sharing site from a single column CSV. It then scrapes a link to a pre-download page, then scrapes the actual download link after a pause while certain ADs are bypassed. There is some logic in place to handle alternate scenarios in Google Drive.

By the way, absolutely love this browser extension. Very well done.

{ "CreationDate": "2018-5-4", "Commands": [ { "Command": "csvRead", "Target": "mylinks.csv", "Value": "" }, { "Command": "open", "Target": "${!COL1}", "Value": "downloadlink" }, { "Command": "label", "Target": "PAGELOAD", "Value": "" }, { "Command": "store", "Target": "${!COL1}", "Value": "!csvLine" }, { "Command": "storeAttribute", "Target": "css=a.shortcode.button.green.large@href", "Value": "downloadlink" }, { "Command": "echo", "Target": "${downloadlink}", "Value": "" }, { "Command": "open", "Target": "${downloadlink}", "Value": "" }, { "Command": "waitForPageToLoad", "Target": "", "Value": "" }, { "Command": "if", "Target": "window.location.hostname != \"drive.google.com\"", "Value": "" }, { "Command": "label", "Target": "ADFLY", "Value": "" }, { "Command": "pause", "Target": "7000", "Value": "" }, { "Command": "storeEval", "Target": "'https://drive.google.com/uc?export=download&id=' + document.querySelector(\".mwButton\").href.replace('https://drive.google.com/open?id=', '')", "Value": "googleLink" }, { "Command": "echo", "Target": "${googleLink}", "Value": "" }, { "Command": "open", "Target": "${googleLink}", "Value": "" }, { "Command": "label", "Target": "WILL DOWNLOAD IF SMALL ENOUGH FILE", "Value": "" }, { "Command": "waitForPageToLoad", "Target": "", "Value": "" }, { "Command": "endif", "Target": "", "Value": "" }, { "Command": "gotoIf", "Target": "window.location.hostname != \"drive.google.com\"", "Value": "CLEANUP" }, { "Command": "label", "Target": "GOOGLE AT THIS POINT", "Value": "" }, { "Command": "storeEval", "Target": "document.querySelector('a#uc-download-link').href", "Value": "googleFinalLink" }, { "Command": "echo", "Target": "starting download", "Value": "" }, { "Command": "open", "Target": "${googleFinalLink}", "Value": "" }, { "Command": "echo", "Target": "download complete", "Value": "" }, { "Command": "label", "Target": "CLEANUP", "Value": "" }, { "Command": "label", "Target": "download was started, pause...", "Value": "" }, { "Command": "pause", "Target": "30000", "Value": "" } ] }

A9T9 commented 6 years ago

Thanks, but can I run this macro? Or does it a require a special login? I need something I can run locally so that I can recreate the issue. It seems at least a test csv file is missing? If you do not want to post this info in a public place, you can email it to team AT a9t9.com and mention this ticket.

Btw, you can mark code with the "< >" button of the ticket editor, like this:

{
"Command": "pause",
"Target": "30000",
"Value": ""
}
Stop commented 6 years ago

I currently am getting the bug and can easily reproduce if needed it seems if the page loads to fast I think you have to activate a flag to wait for page load?

A9T9 commented 6 years ago

and can easily reproduce

Sounds good. Is there a way we can reproduce it as well?

shambampow commented 6 years ago

Is there a way we can reproduce it as well?

@A9T9 I'm also experiencing this and it hangs my loops fairly often, forcing me to "pause" and then "resume" manually via the buttons in order to continue the execution.

Here is a quick demo you can run: { "CreationDate": "2018-6-7", "Commands": [ { "Command": "onError", "Target": "#goto", "Value": "_end" }, { "Command": "waitForPageToLoad", "Target": "500", "Value": "500" }, { "Command": "storeEval", "Target": "window.document.getElementsByTagName('html')[0].nodeName", "Value": "_htmlName" }, { "Command": "echo", "Target": "${_htmlName}", "Value": "" }, { "Command": "label", "Target": "_end", "Value": "" } ] }

Run this on a loop for set to like 9999. Then, manually refresh your page a few times while it's running. The macro loop will hang, and the internal TIMEOUT variables all seem to not do anything for this method. It will just stop the execution until manually paused/resumed. Also, neither the Target or Value options are passed to the function currently, and it would be ideal if they worked. Ideally, it would bail out on error and go to the next Loop iteration (per the "If error happens in loop" setting).

I have my Timeout_Pagelaod set to 5, and TIMEOUT_WAIT set to 0.

Refreshing a few times while executing this method on any page, I'm able to hit the indefinite wait issue by the 11th loop.

A9T9 commented 6 years ago

@shambampow Thanks, I confirmed this issue. I will update this ticket once it is fixed.

A9T9 commented 6 years ago

@shambampow Maybe I ask why you hit refresh when the macro is running? We try to understand the use case here, so we can fix it correctly.

link7777 commented 6 years ago

I have the same problem with a script. It freezes on different commands at different times when runs on a loop for a long time, usually every 10-40th loop every time on a different command. I don't refresh the page during execution, but my script runs through 5 pages every loop, so the pages are refreshed by the script itself. I can't share my script and help to reproduce the bug, as my script was created for the part of third party website after log in. I tried to reproduce the bug on another pubic open website, but wasn't able to do that. Is it possible to get any additional debugging info from Chrome plugin? I run Kantu Browser Automation 3.0.3, on Google Chrome Version 67.0.3396.87 (Official Build) (64-bit), macOS highsierra 10.13.5

nlenny885 commented 6 years ago

Same issue here. Kantu Browser Automation 3.0.3, on Chrome ver.66, PC Win7 (64-bit) SP1 . Freezing when running the loop at the following commands: Open, Pause. Sometimes it also gets frozen at "If". Does not trigger Timeout event - counter stops. Manually pausing and resuming brings the execution back until it freezes again - and so on. I cannot figure out the pattern - sometimes it runs the loop 25times before freezing, sometimes it stops every 2-3 loops which makes the whole macro useless. The issue never appeared with demo macros, but tbh. I have not tested them in high loop counts. My macro is also on a third party site requiring login but I plan to make one open that I can provide.

A9T9 commented 6 years ago

My macro is also on a third party site requiring login but I plan to make one open that I can provide.

That would be great!

shambampow commented 6 years ago

@shambampow Maybe I ask why you hit refresh when the macro is running? We try to understand the use case here, so we can fix it correctly.

@A9T9 refreshing the page in this scenario is just the best way to demonstrate the source of the issue. However, my macro also plays with multiple pages. I run through a spreadsheet of ID's, and search through and update product variables en-mass in 3 different backend systems. Sometimes I do need to refresh the page in order to reload something, or re-do something. Sometimes I click a link while the macro is playing to go to another screen. The macro gets stuck without any way to end (other than manually pausing and resuming, or stopping and re-starting the macro), and no timeout that I can set seems to impact this result. I would be happy with a maximum execution timeout per step which could fail the current loop execution if breached and move to the next (or whatever the onError logic is set to).

The way I am using Kantu is to semi-automate a good number of browser clicks while I also physically am manning the mouse to do some of the work. Bringing the total number of clicks per ID down from ~25 to only about 5.. which really saves my fingers and joints!! I run a constant loop in Kantu, using javascript to scan for various elements on a page, and then do certain tasks if they exist, and then go to the next loop. I hope that shows why the page would get refreshed - Kantu is the clicker and does a good amount of heavy lifting, and I direct it to various pages.

nlenny885 commented 6 years ago

I tried to run my macro outside of the environment of the third party site (where the freezing bug frequently occurs at Pause and Open commands) and I could not reproduce the freezing. I replaced the .csv file with my actual desired URLs of the third party site, with the URLs of Google and Bing and the identical macro made 500 rounds without any freezing. I am wondering what makes the difference. scrapedlinestest_new.txt

Bradyrh commented 6 years ago

@A9T9 I made a public test macro that should hopefully allow everyone to duplicate this issue. I have been running into it almost every time I run this macro, I've tried to add a pause to see if that helps but it seems to still get stuck. Then I need to pause and resume my macro and it continues fine until it repeats, I was running into this issue through a macro on a third party site and came across this forum when searching for a fix. I made the states macro to help prove that this does seem to be a bug, that happens to me on both the latest version of Chrome and Firefox, with the most recent Kantu extension. Would appreciate if you could look into this! States.zip

link7777 commented 6 years ago

Is there any hope this issue could be fixed in the nearest future?

A9T9 commented 6 years ago

Yes, the "states" example from @Bradyrh was very useful. We plan to make some bigger changes with the next update the hopefully fixes this issue for good.

eacguardinjection commented 5 years ago

Is there an ETA on this fix? I am having the same problem.

A9T9 commented 5 years ago

Yes :-) => End of this week the beta version with a solution for the "IPC issue" should be ready. If you want to help test it then, you can sign up here: https://a9t9.us11.list-manage.com/subscribe?u=ce17e59f5b68a2fd3542801fd&id=e9fe3bc413

haishee commented 5 years ago

Open command works fine but what I have noticed is when I use open command to open a XML payload in a browser, it freezes.

A9T9 commented 5 years ago

@haishee Do you have a test macro this issue?

link7777 commented 5 years ago

Have you released beta version already? I've signed up via the link that you provided, but didn't get any emails yet.

A9T9 commented 5 years ago

Hi, not yet... but hopefully in the next days

TFD777 commented 5 years ago

Hello, @A9T9 , so I've also faced the same issue and tried to change my macros to avoid the freeze, but you know, running from the issues is never a solution. So apparently if you run the macro and the page refreshes during the "PAUSE" or "gotoIf" command (which can happen in some web pages where you change a field and submit), then it hangs and you can only resume it by manually clicking the "Pause" and then "Resume" buttons which means that you cannot leave the macro running by itself and have to constantly keep checking if it's still running... I've written two macros that help to reproduce these errors 100% on any website. First one is for Pause - simply hit the refresh button while the "Pause" command is running and it will freeze immediately. { "CreationDate": "2018-8-8", "Commands": [ { "Command": "pause", "Target": "10000", "Value": "" } ] }

The second one with "gotoIf" is a bit trickier, but also works ~90% of time - simply wait when the macro begins the "gotoIf" command and hit the refresh button, I've added 10 "gotoIf" commands so you can always hit refresh when the command is running:

{ "CreationDate": "2018-8-8", "Commands": [ { "Command": "store", "Target": "10", "Value": "countdown" }, { "Command": "label", "Target": "COUNTDOWN", "Value": "" }, { "Command": "echo", "Target": "Counting down - ${countdown}", "Value": "" }, { "Command": "gotoIf", "Target": "\"${countdown}\" == \"0\"", "Value": "END" }, { "Command": "gotoIf", "Target": "\"${countdown}\" == \"0\"", "Value": "END" }, { "Command": "gotoIf", "Target": "\"${countdown}\" == \"0\"", "Value": "END" }, { "Command": "gotoIf", "Target": "\"${countdown}\" == \"0\"", "Value": "END" }, { "Command": "gotoIf", "Target": "\"${countdown}\" == \"0\"", "Value": "END" }, { "Command": "gotoIf", "Target": "\"${countdown}\" == \"0\"", "Value": "END" }, { "Command": "gotoIf", "Target": "\"${countdown}\" == \"0\"", "Value": "END" }, { "Command": "gotoIf", "Target": "\"${countdown}\" == \"0\"", "Value": "END" }, { "Command": "gotoIf", "Target": "\"${countdown}\" == \"0\"", "Value": "END" }, { "Command": "gotoIf", "Target": "\"${countdown}\" == \"0\"", "Value": "END" }, { "Command": "storeEval", "Target": "${countdown}-1", "Value": "countdown" }, { "Command": "gotoLabel", "Target": "COUNTDOWN", "Value": "" }, { "Command": "label", "Target": "END", "Value": "" }, { "Command": "echo", "Target": "Time's up!", "Value": "" } ] }

I've also noticed that the command "waitForVisible" sometimes doesn't work properly, too and timeouts even though the element is visible, but at least the script is still running and I can add the "!LASTCOMMANDOK" check. Anyways if the timeout it set to minute or longer then a lot of time is being wasted... I really hope this issue will be fixed, I look forward to participate in beta testing and provide all the necessary feedback in order to improve this tool. :)

link7777 commented 5 years ago

Hi @A9T9 ,

Are there any news about beta version with the fix?

A9T9 commented 5 years ago

I am testing an internal beta right now... a public beta should be only days away.

TFD777 commented 5 years ago

@A9T9 any update? This bug is really limiting the usage of the app, because it affects the following commands - "Pause", "gotoLabel", "while", "if" and so on... And I've spent lots of hours rewriting my code to avoid this bug, but there is no workaround or at least I couldn't manage to find one... so please... we need this bug to get fixed... :(

A9T9 commented 5 years ago

A beta version that should fix most of the IPC issues is available at

https://chrome.google.com/webstore/detail/dpdlhdbnlaefobeejcgfidghdllhemkl/

Please let us know if this version works for you. Some IPC issues might be still there in this version, if you encounter them, let us know here or in the forum.

TFD777 commented 5 years ago

@A9T9 I have tested the new version and looks like the Pause works fine now, however it still hangs on "While" command...

TFD777 commented 5 years ago

@A9T9 after more testing I can finally say that I'm really happy with this update - I've managed to write my macro without "While" loops (I've changed them to "gotoIf" with labels) and now it seems that everything is working fine. Thank you very much! 👍

A9T9 commented 5 years ago

@TFD777 Thanks for the feedback, that sounds good.

So what is still open for us to fix before we can close this ticket is:

If anyone else still gets "IPC issues" in other use cases, let us know! Now is the best time to report them.

A9T9 commented 5 years ago

All fixed with V3.1.6 :-)

If you still find IPC related issues, please let us know. But according to our tests, all looks good now. Thanks a lot for all the feedback, help and patience.

Kpier commented 5 years ago

@A9T9 We're actually been running into this issue when running 4.0.1 with chrome up to date - We reach "[error] timeout reached when looking for" at a certain line in our csv, then delete all the lines prior to this one, and restart the macro, to which it then runs fine.

Any thoughts to why this may be recurring?

deedeekaka commented 5 years ago

Still seeing this issue in 4.1.12 where the execution of commands just randomly stops. Not really sure what's doing this, but usually pausing then resuming will continue the command execution. After resuming, I always get a [error] macro 'macro name' timeout 900s (change the value in the settings if needed) error.

A9T9 commented 5 years ago

Yeah. We plan to finally address this issue with the next updates in April and May. The issue will be gone before summer arrives ;-)

condovacay commented 5 years ago

Any update on this. It says closed but my macro locks up like the issues raised above. Code loops through 16 records on a page and then does 16 inserts/submits on a webpage. the macro locks up/freezes at very random places throughout the script. I can also say that when I put the execution speed at FAST, it runs slower and slower as the macro progresses. occasionally the macro restarts on its own but rarely. the pc does not freeze, just the execution of the macro.

jrmsmith63 commented 4 years ago

The macro name' timeout 900s (change the value in the settings if needed) error still seems to randomly occur on any macro that I run on 5.1.9. I notice it happens around 10-25 loops of the macro, especially on pause commands. Once the bug occurs, it may take a couple of restarts for the macro to run properly. I also notice that the error more often running the macro on fast than on slow or medium but it does occur no matter what setting I change.

cosmoras commented 4 years ago

Same issue as jrmsmith63 on 5.1.9 under firefox/win 10. I will test on Linux and report if found a workaround. I am using run subscripts, Do loops and pause and Tabs=0 Tab=1, etc. I will try to refactor for using labels for loops as another user above to see if there is any luck.

LucaAlimandi commented 4 years ago

Good evening Faced the same problems with Kantu 5.2.3 (Chrome). .... [info] Executing: | select | id=search:operationForFileUpload | label=${operation} | [info] Executing: | waitForElementNotPresent | xpath=/html/body/div[8] | | [error] macro '4 - Check CSV-XLS Files' timeout 100000s (change the value in the settings if needed) [info] Macro failed (Runtime 27.28s) ....

Same using !TIMEOUT_MACRO 900 s (as default) or any other. I'ma using RUN and LOOPING (expecially While..End): ... { "Command": "run", "Target": "4 - Check CSV-XLS Files", "Value": "" }, ... { "Command": "while_v2", "Target": "${!csvReadStatus} == \"OK\"", "Value": "" }, ...

I also use DOWLOAD of files and SAVE CSV files. It seems that the problem rises when I insert PAUSE commands inside the scripts. I had many faults in long loops, just after the first 30 - 40 iterations. Then I worked out how avoid the use of PAUSE to wait for dropdown list elements to be populated using WaitForElementNotPresent and it seems that the problem rises less often.

The problem rises immediatelly if I manually pause the execution of the script.

I Hope this issue will be fixed definitively in short time! :-)

Thank you very much

LucaAlimandi commented 4 years ago

As previously stated, I have eliminated all PAUSE commands from the script, and used WaitForElementNotPresent to wait for drop down lists to be populated. I used this command in that when the page I am testing is populating the list box a DIV is added in front of the page that "hides" the page and prevents the user clicking too early... And normally this works perfectly! But anyway the problem still rises at random. Some time after 10-15 iterations, other times after 100+ iterations. Very impredictable... I also tried to disactivate notifications both in Windows 10 and in Chrome, but nothing has changed. I will try substituting the WHILE .. END loop with GOTOIF commands, as TFD777 did. I'll let you know... Anyway it should be a good thing if the WHILE .. END lopp could be fixed in that it seems much more readable and manageable. Finally I confirm that manually pausing the script leads to fail, at least in my own script. Waitng for news about the topic!

Thanks

LucaAlimandi commented 4 years ago

Made new trials... Eliminated all PAUSE, eliminated all WHILE loops (subsituting with GOTOIF), tried eliminating download of files, tried eliminating WaitForElementNotPresent commands, set the !TIMEOUT_MACRO variable to higher values (10000 and even 99999999) ... Nothing to do!!! Even using: { "Command": "store", "Target": "true", "Value": "!errorIgnore" } at the beginning of the macro that presents the problem the error: macro '4 - Check CSV-XLS Files' timeout 100000s (change the value in the settings if needed) continue to happen at random time. I have noted that if I iconify Chrome during test execution, the error rises almost immediately. Any idea?

LucaAlimandi commented 4 years ago

After using !errorIgnore = true, I noticed that after the timout error there are many lines following in the log, like this:

[info] Executing: | csvRead | omp_table_registry.csv | | [error] macro '2 - Open Massive Upload' timeout 10000s (change the value in the settings if needed) [info] Macro failed (Runtime 961.31s) [error][ignored] token expired [error][ignored] token expired ...

What does this mean?

LucaAlimandi commented 4 years ago

It seems havig to do with accessing lines in the CSV file that drives the test loop...