After forcefully closing the application, screen.type() will work for few second and will give inputs to desktop or other apps.

Asked by bal krishna gupta

hi,
I have automated one mainframe quick3270 application using sikuli. Here i am giving input to mainframe screen using screen.type() command. When i ran my application, sometime some wrong value will go to quick3720 mainframe screen especially in credential fields. then i need to forcefully close my application but the problem is after closing the application the execution wouldn't stop and
screen.type() will still work for few second and the values from screen.type() will be given to desktop or some other application. And this lead a big problem because it will mess them totally . So how to stop the execution totally after closing the application which is automated using sikuli ? the main concern is screen.type() should stop immediately after forcefully closing the application.

thanks,

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
masuo (masuo-ohara) said :
#1

When the application is open, is there any unique image on the screen?
if so, to confirm the unique image by exists() before type() may be a solution.

[for example:]
if exists(unique image):
  type()

By the way, why some wrong value will go to quick3720 mainframe screen?

[excerpt of document:]
Since type() is rather slow because it simulates each key press, for longer text it is preferrable to use Region.paste().

Revision history for this message
bal krishna gupta (bkg-krishna) said :
#2

Hi masuo thanks for your reply.

No, there is no unique image on the screen.

the application will be used by many user and the user id and password will be maintained in a property file. some times what happen if suppose a wrong password or userid enter into property file by some user then screen.type() will send wrong creds to quick3720 mainframe screen and then execution will collapse due to locking issue and there need to close the application forcefully.

So, i need the way, if i am forcefully closing the application the execution should stop immediately and screen.type() command should not throw any thing to system.

thanks,

Revision history for this message
masuo (masuo-ohara) said :
#3

When you need to close the application, how do you close the application?
keyboard or mouse?
Even if it is difficult to interrupt script automaticary, it is easy to interrupt script by hand.
If you are running script from SikuliX-IDE , you can interrupt Sikuli-IDE with ALT+SHIFT C from keyboard.
If you are running script from commandline, you may add hotkey to interrupt the script.

Revision history for this message
bal krishna gupta (bkg-krishna) said :
#4

I will close my application with mouse.

I have created a jar file for the scripts. I ran the jar for execution. when I need to forcefully stop the execution then i will close the application with mouse but execution will not stop and screen.type() will throw the input data to desktop and other applications which will be currently active on my system.

Thanks,

Revision history for this message
Best RaiMan (raimund-hocke) said :
#5

--- I have created a jar file for the scripts. I ran the jar for execution.
How exactly do you do that:
create?
run?

--- then i will close the application with mouse
I suppose, the jar file is not the application.
The application is some stuff, that is automated by your scripts !?

so, if jar file and application are 2 different things: How does your script make sure, that the application is running?

If you do not do this, then it is possible to close the application and your script will only stop with the next FindFailed.
How should SikuliX know, that your application is no longer running (which is the target of the type)?

So go back, rethink you concept and correct the not wanted behavior (some tipps are already mentioned before).

Revision history for this message
bal krishna gupta (bkg-krishna) said :
#6

Thanks RaiMan, that solved my question.

Revision history for this message
bal krishna gupta (bkg-krishna) said :
#7

got the mistake which I was doing...
thanks...!!