Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command prompt not closing after execution - pending replication details #551

Closed
ItsSandeepThota opened this issue Sep 3, 2019 · 28 comments
Labels

Comments

@ItsSandeepThota
Copy link

Hi @kensoh ,

After the execution of the all the steps in the code my command prompt was getting closed. After that there were no other steps for execution even, do not know why that was happening. Can you help in resolving this issue.

Thanks in advance.

@kensoh
Copy link
Member

kensoh commented Sep 3, 2019

Hi @sandeep14897 can you provide replication step by step how to create this? If you run TagUI script by typing tagui script_name, after execution your command prompt should still remain open. If you set up TagUI to run by double-clicking a batch file to run the script, after execution Windows will auto-close the batch file and TagUI.

@kensoh
Copy link
Member

kensoh commented Sep 3, 2019

And do you mean command prompt not closing (issue title) or closing (issue description)?

@kensoh kensoh added the query label Sep 3, 2019
@kensoh kensoh changed the title Command prompt not closing after execution Command prompt not closing after execution - pending replication details Sep 3, 2019
@ItsSandeepThota
Copy link
Author

ItsSandeepThota commented Sep 3, 2019

@kensoh I am running TagUi script as tagui file_name chrome. After executing all steps in the code the execution was not stopping, and there were no activities to execute further.

@kensoh
Copy link
Member

kensoh commented Sep 3, 2019

I see.. I have not encounter this problem before. Can you try if the same problem happen on another laptop or computer? Maybe your colleague computer, and see if the issue happens?

Without details to replicate the issue, it is hard to troubleshoot the problem from my computer.

@kensoh
Copy link
Member

kensoh commented Sep 3, 2019

Some other things you can try is run simple script like below and see if it works. But the best will be try your script on another colleague's laptop to see if the same issue happens. If another laptop works, then find the difference between the 2 laptops to see if it is due to some environment settings or security / firewall / virus scanner issues.

Run tagui demo_script on the command prompt.

demo_script

echo '123'

@ItsSandeepThota
Copy link
Author

@kensoh to use tagui demo_script i should do automation in chrome. if i run like that i was not able to open chrome. I have also tried in my collegue system it was also having the same issue.

These are the cmd's those are open in back ground can you please refer these.

Capture
Capture1
Capture2

@kensoh
Copy link
Member

kensoh commented Sep 3, 2019

From your SikuliX log file, it looks like there may be some admin issue. When I try to run a simple script on my laptop (macOS), there is no error message like your one saying mouse actions are blocked.

script

click pc.png

pc.png

pc

It will be difficult to troubleshoot as I don't have your laptop environment config to test. Instead of using clicking on the close-file-explorer image, are you able to use keyboard combinations to do what you need? For example, keyboard [esc] will simulate an escape key, keyboard [alt][f4] will simulate Alt + F4. Also make sure that you are running the latest TagUI version -

https://github.com/kelaberetiv/TagUI#set-up

@kensoh
Copy link
Member

kensoh commented Sep 5, 2019

Let me know if you try to run a simple script like above example works?

For eg click on the Windows start menu button. If the simple example does not work, then most likely it is due to the error message in your SikuliX log above, saying that the automation was launched without appropriate user permissions

@ItsSandeepThota
Copy link
Author

Hello @kensoh
Sorry for the late response, Actually i have tried with a simple script and that works fine. but when i iterate the sequence of steps by placing it in a loop. I was facing the issue.

And also can I know if TagUI can work in the VM (background automation) if we schedule it in Windows task scheduler. If Yes, can i know the VM requirements. Please, let me know.

Thanks

@kensoh
Copy link
Member

kensoh commented Sep 5, 2019

I see.. Can you try to create a minimal replication script with the loop and a simple click to see where could the problem happen? After you create the most basic script with loop and click image that has this problem, share with me the script so I can try to replicate the behaviour.

I see.. I know some enterprise users of TagUI run it on Windows VM, but I don't know the details of their implementation because it is done directly by their IT team and I have no visibility. You can try it out to see if that works.

For VM requirements, TagUI just need a basic computer specs to work. It can run on macOS, Windows, Linux. But I have not tested how far back in Windows versions will it run properly.

@ItsSandeepThota
Copy link
Author

Hi @kensoh . My problem was similar to #417. In the background my tagui cmds are still open. Can i know where should i use the helper scripts. I was trying to write a batch file, for scheduling my bot and can i write helper scripts in batch file? after tagui filename chrome can i use helper script to shut down background processes? Can you please let me know.

Thank you

@kensoh
Copy link
Member

kensoh commented Sep 7, 2019

Hi @sandeep14897 I see.. Yes you can try that using batch files. The helper scripts to kill all TagUI processes is in src folder. For Windows it is end_processes.cmd.

However, if your environment does not let TagUI to terminate and return control back to the batch file, then when you put end_processes.cmd after the tagui filename chrome the helper script may not have a chance to run. In any case, try and see if your idea works.

@kensoh
Copy link
Member

kensoh commented Sep 7, 2019

Another way to implement is call these helper script at the start of your batch file, or have it scheduled in task manager. So that the open windows are terminated when you run the next time, or when user need to use the laptop.

@ItsSandeepThota
Copy link
Author

ItsSandeepThota commented Sep 7, 2019 via email

@kensoh
Copy link
Member

kensoh commented Sep 7, 2019

I have not done testing of TagUI for VM, but I will think 2GB is enough. From my understanding of VM, if the VM is not online, then it only exists as an image and does not do anything at all.

@ItsSandeepThota
Copy link
Author

ItsSandeepThota commented Sep 7, 2019 via email

@ItsSandeepThota
Copy link
Author

ItsSandeepThota commented Sep 7, 2019 via email

@kensoh
Copy link
Member

kensoh commented Sep 7, 2019

The main processes that are running are PhantomJS, Chrome and if visual automation is used, SikuliX (which is based on Java).

Performance testing was never done in breadth for different types of computer specifications for TagUI, as it wasn't designed to be run on VM, so there is no data on minimum requirements.

@ItsSandeepThota
Copy link
Author

ItsSandeepThota commented Sep 7, 2019 via email

@kensoh
Copy link
Member

kensoh commented Sep 9, 2019

Closing this issue to follow-up at #560 on using helper script to kill processes.

@kensoh kensoh closed this as completed Sep 9, 2019
@ItsSandeepThota
Copy link
Author

Hi @kensoh

Mouse actions are blocked generally or by the frontmost application. You might try to run the SikuliX stuff as admin.

I was getting this message in console and end_process also not executing as it was not getting to next step in batch file. If i should run as admin how can i do that?

Thank you in advance.

@kensoh
Copy link
Member

kensoh commented Sep 11, 2019

Hi @sandeep14897 when you click to run command prompt, try to right-click and see if there is a menu to run as admin. See if that helps.

Interesting, I have not yet heard feedback on the end_processes.cmd not working. Can you share more what is your Windows system version and what folder you install TagUI?

@ItsSandeepThota
Copy link
Author

Hi @kensoh

I am using TagUi in VM and also in Window 10 machine. My VM specs are Windows server 2019 datacenter 64 bit operating system.

I have installed tagui in C:\apps\tagui\src.

Thank you

@kensoh
Copy link
Member

kensoh commented Sep 12, 2019

The folder name seems ok, and the Windows spec. Have you try the most minimal script that can produce the error? You said above when you add for loop script hangs, but without for loop script is ok.

What is the shortest script that you can write with for loop that can hang the system?

@kensoh
Copy link
Member

kensoh commented Sep 12, 2019

Lastly, can you find a Windows laptop with similar spec and setup as your VM. And try if that works? If that works on the Windows laptop, then it means there is some issue using on VM. TagUI has not been tested and designed to work on VM, but I heard of successful deployments by users.

@ItsSandeepThota
Copy link
Author

Hi @kensoh

This is my batch file
BatchFile

I was not able to execute end_Process command as i was struck on

ErrorInSikulix
SampleScript

@ItsSandeepThota
Copy link
Author

Hi @kensoh

I want to schedule my bot through task scheduler for every 10 minutes of duration whether the user is logged in or not and I shut down the VM. But my task was not scheduling can i know why? Sikulix Operations are not performed when i come out of VM.

Thank you

@kensoh
Copy link
Member

kensoh commented Sep 12, 2019

I see.. I'm afraid I'm unable to help further.. Above screenshot seems to show that the execution run all the way until vision type step at the bottom and then stuck there without exiting. It might be SikuliX or might be the way TagUI's execution engine PhantomJS works in VM. Your use case in VM probably can't work. See if anyone else experience the same problem and feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants