chobo2

How to Handle Crashes?

18 posts in this topic

Hi

I am wondering what is the best way to handle "autoit script has stopped working" and how to handle when the application autoit is testing crashes. 

I noticed sometimes that when I run my scripts I will get one of those 2 errors. It happens maybe once every 10 times but I would like to somehow be able to get information of why it happened(was it autoit that crashed the program or is there a bug in the program it is testing).

 

Thanks

Share this post


Link to post
Share on other sites



Your question is rather broad, you should be more specific, for example what application you are "testing", and post your code.

However, generally speaking, you avoid the issues you are having by writing good robust code with error checking .


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

If it is not compiled,  meaning running from scite, you will get better error messages after a crash in the console. But as JohnOne as stated, putting error checking in place, is the best way.


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites

It is a custom application written a very long time ago.

I just notice that somehow autoit can crash it. It is not always but all of sudden autoit will do something and the entire application will stop to respond and will show some cryptic error. No clue why it happens can't add more debugging to the app it is testing and it does not always happen.

Then sometimes I will run my autoitscript and I will get "autoit stopped responding" and will say nothing else.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

2 hours ago, chobo2 said:

autoit stopped responding

Is this cryptic message you are referring to, and if not then what is it?

Edited by czardas

Share this post


Link to post
Share on other sites

I get 2 error message that randomly happen

1. "autoit script stopped working"

2.  "app has stopped working. A problem caused the program to stop working correctly. Please close the program"

Both happen sometimes and number 2 only happens when autoit tests are run. Never when used by people and its been used for a long time.

Share this post


Link to post
Share on other sites

and where is the script which crashes?

Share this post


Link to post
Share on other sites

@chobo2,

when you see "app has stopped working", it means Windows tried to communicate with the app to query its status, but the app was busy and could not respond in due time.

so it seems your script is putting too much pressure on the app - so you see the 2nd message. since AutoIt itself is not built for heavy computational load, it may get too busy executing the tests on the app - hence the 1st message.

so, what exactly is your script doing to your app?

P.S. that is a polite way of telling you what AutoBert said right above this post.

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Here is one issue

The script that I just got this error on was trying to load up excel to grab data from it(it never got past grabbing data....about 10 rows in that particular worksheet was trying to grab so very little of data) and then to use that data to validate if that same data by going through multiple screens(opening a window, check if whatever is there, closing that window, moving to a next window and so forth).

How can I test if it is a hanging issue or a memory issue? What can I do to minimize the load  on autoit Autoit?

 

stoppedWorking.JPG

Edited by chobo2

Share this post


Link to post
Share on other sites
47 minutes ago, chobo2 said:

I just got this error on was trying to load up excel to grab data from it

Show the function which you are using to grab=get data from excel.

 


NEW:     ADO.au3 UDF     POP3.au3 UDF     XML.au3 UDF    How to use IE.au3  UDF with  AutoIt v3.3.14.x  for other useful stuff click the following button:

Spoiler

Last update: 2016-11-12
Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft Components * TeamViewer API -UDF * JavaManagement UDF * VIES over SOAPPOP3.au3 UDF *  RTF Printer - UDF * XML.au3 - BETA * ADO.au3 UDF SMTP Mailer UDF * WinSCP UDF *

My contribution to others projects: * _sql.au3 UDF  *

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Best coding practices * 

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities *

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, The Art of Computer Programming
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

 

Share this post


Link to post
Share on other sites

@chobo2,

12 hours ago, chobo2 said:

It is a custom application written a very long time ago.

 

7 hours ago, chobo2 said:

trying to load up excel to grab data from it

as far as i know, Excel is not "a custom application written a very long time ago".

 

now, you've been asked politely several times to show your script. this is so we may review it and help you find the cause of the issue. if you do not show your script, anything anyone can say is purely theoretical, with little to none actual benefit.

so, why are you refusing to show your script?

 

 

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

17 hours ago, orbs said:

@chobo2,

 

as far as i know, Excel is not "a custom application written a very long time ago".

 

now, you've been asked politely several times to show your script. this is so we may review it and help you find the cause of the issue. if you do not show your script, anything anyone can say is purely theoretical, with little to none actual benefit.

so, why are you refusing to show your script?

 

 

No Excel is not a custom application. But as far as my autoit tests use excel is to grab data out of it and use it in a custom application.

If you want to see that code you can see it here as I am had problems with it in the past but now I have different problems(before it at least gave me an error now I am running into the script stopping)

I am looking for general ways to figure out how to properly debug my scripts.  Posting my scripts is not an option as I am finding out this error likes to move around. One day it dies on Script 5, next time it could be Script 8, next time it could be who knows. 

I would have to post so much code up that no one could run as you need the customer application that I don't see any benefit until I can narrow down the error. 

All tests run by themselves just fine. It is just went running one after another is when I see these problems

 

Edited by chobo2

Share this post


Link to post
Share on other sites

So it is the customers application that is crashing, and not your autoit script? If that is the case, it is going to be very hard for anyone to help you, as we do not have your script, nor the customers application (custom application at that), plus the data being pulled from Excel.

If they are running by themselves, though (your scripts), why not run them one at a time? Meaning split up your code to only do one thing it is supposed to do. That way, when the error does occur, you can narrow it down to that one part.

Not sure anyone else is going to have a better answer, but they might.


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites
14 hours ago, chobo2 said:

I am looking for general ways to figure out how to properly debug my scripts.

then you have been given general answer right in post #2.

14 hours ago, chobo2 said:

If you want to see that code you can see it here

if you already opened a forum topic, stick with it. also, your code there does very little for error checking, if any at all - and now i see that entire topic is full of people - one of them is the Excel guru - telling you to do proper error checking.

 

Share this post


Link to post
Share on other sites

#16 ·  Posted

22 hours ago, nitekram said:

So it is the customers application that is crashing, and not your autoit script? If that is the case, it is going to be very hard for anyone to help you, as we do not have your script, nor the customers application (custom application at that), plus the data being pulled from Excel.

If they are running by themselves, though (your scripts), why not run them one at a time? Meaning split up your code to only do one thing it is supposed to do. That way, when the error does occur, you can narrow it down to that one part.

Not sure anyone else is going to have a better answer, but they might.

Well like I said I get 2 errors. 

1. Sometimes the scripts just stop working

2. Sometimes it is actually the custom application that stops working.

Each script is run at one at a time. Each test is written as a function. There is one function that has all the tests in it. The first function(ie test) is called, once it finished it moves onto the next and so forth.

This is where I run into problems as if I run each test manually one at a time it does not seem to have problems. It just seems to have problems when one after another happens.

I

Share this post


Link to post
Share on other sites

#17 ·  Posted

9 hours ago, orbs said:

then you have been given general answer right in post #2.

if you already opened a forum topic, stick with it. also, your code there does very little for error checking, if any at all - and now i see that entire topic is full of people - one of them is the Excel guru - telling you to do proper error checking.

 

Just saying " writing good robust code with error checking" does not help me. What causes an autoit script to stop working? What should I be checking for? How do I catch an error that would case "autoit script stopped working"

Share this post


Link to post
Share on other sites

#18 ·  Posted

7 hours ago, chobo2 said:

What causes an autoit script to stop working?

Possible runtime errors, not handled by a solid errorchecking.

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