Sign in to follow this  
Followers 0
Xieciunio

Control not found reaction

6 posts in this topic

Hi,

I am creating automation script for desktop application. Is there any way to change script reaction for situations when script is unable to find a control? Normal reaction of script is to pause. Is it possible to change this reaction for something like msgbox or executing other function? I know that I could check is control available, but doing this every time will take lots of time while scripting.

Regards

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Have you tried:

ObjEvent ("AutoIt.Error", "_onerror")

;;;;;;;;;;;;Script;;;;;;;;;;;;;;;

Func _onerror ()
   MsgBox (0, "", "Error!!")
EndFunc ; ==> _onerror
??

Or does that not do it? What functions are you using? You could make a timout...

MDiesel

Edited by mdiesel

Share this post


Link to post
Share on other sites

Hi,

I am creating automation script for desktop application. Is there any way to change script reaction for situations when script is unable to find a control? Normal reaction of script is to pause. Is it possible to change this reaction for something like msgbox or executing other function? I know that I could check is control available, but doing this every time will take lots of time while scripting.

Regards

Post code that reproduces your issue. AutoIt scripts DO NOT pause just because a control is not found, unless you coded it that way with a loop that has no error handling or something.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Post code that reproduces your issue. AutoIt scripts DO NOT pause just because a control is not found, unless you coded it that way with a loop that has no error handling or something.

My mistake about pausing. I am talking about simple situations/functions like:

1. Function Click with argument pointing to control that cannot be found

2. New child window will appear and script will not be able to continue

3. Application will close (this is where scritp will be "paused"(red "X" is flashing in tray) if I have any WaitWindow-like functions)

I need to write scripts for application where this situations will appear and wish to be able to react automaticly

Unfortunetelly this situations are not treat like errors, and as far as I know error handling will not catch it.

Share this post


Link to post
Share on other sites

My mistake about pausing. I am talking about simple situations/functions like:

1. Function Click with argument pointing to control that cannot be found

2. New child window will appear and script will not be able to continue

3. Application will close (this is where scritp will be "paused"(red "X" is flashing in tray) if I have any WaitWindow-like functions)

I need to write scripts for application where this situations will appear and wish to be able to react automaticly

Unfortunetelly this situations are not treat like errors, and as far as I know error handling will not catch it.

Still need to see a reproducer to show what the issue is. None of the situations you describe need to hang a properly coded script. Take them one at a time, if that helps. Post a short reproducer script to demo your "Function Click" issue.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Sorry for no reply.

I think that all that I needed was to spend more time with documentation. All this functions that I wish to monitor (click, winwait etc.) are returning 0 if there is something wrong. To resolve all my problem, I just need to monitor this returns witch is not hard to do. I do not have a clear solution for coding-less monitoring jet, but I think that I have compromised myself with this question enough :) Sorry for taking your time and thank You for fixing my way of thinking :party:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0