cancel
Showing results for 
Search instead for 
Did you mean: 

Keyword handling exeption

SOLVED
Highlighted
Occasional Contributor

Keyword handling exeption

Hello,

I have created a script macro in delphi and several keyword witch work with an exe, i would like to manage error when trying to add data already existing in app.

ex : windows add tiers "toto" > Error already existing

I ve tried Try catch but not catching anything, script crash and stop no action further.

Normaly i would get result := false with an mail send procedure et run another tasks.

Do you have any idea?

 

 

log_TC_0001.jpg

log_TC_0002.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Occasional Contributor

Re: Keyword handling exeption

Thanks for youre answers, i finally manage this case with try catch and if object exist in the keywordTests

If we don't find this windows the action continue and finish action creation, else if windows show up catch error return false and send mail.

 

TC_result.jpg

View solution in original post

3 REPLIES 3
Highlighted
Community Hero

Re: Keyword handling exeption

As the log says, the automation halted because you have configured your project to stop execution on errors.  Basically, as soon as an error shows up in the log, the project will halt.

 

See https://support.smartbear.com/testcomplete/docs/testing-with/running/control-test-flow/stop-after-fi... which shows where these settings are that you can then change to NOT halt on error.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Community Hero

Re: Keyword handling exeption

Hi,

 

In addition to what was suggested by Robert:

Try/Catch keyword operations, likewise the same operators of programming/scripting languages, handle execution runtime exceptions like division by zero, stack overflow, etc. Extra window displayed on the screen is not an exception and thus it is not handled by try/catch.

Extra windows in TestComplete can be handled using one of two ways:

a) Do explicit check if an extra window is displayed on the screen using .WaitWindow()/.WaitAliasChild() methods. If the window is found, handle it appropriately;

b) If an extra window is modal one (i.e. it prevents access to all other UI elements of the tested application until the window is closed -- this is your case, according to test log), then you may create a handler of the OnUnexpectedWindow event and handle displayed window within this handler.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
Occasional Contributor

Re: Keyword handling exeption

Thanks for youre answers, i finally manage this case with try catch and if object exist in the keywordTests

If we don't find this windows the action continue and finish action creation, else if windows show up catch error return false and send mail.

 

TC_result.jpg

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors