"Exception Handling" Usage

Alternative Player
In this video you will learn how to use Exception Handling in ZAPTEST. In my first example I will define Exception Handling rule to stop test execution on any ZAPTEST error. In my script the first step imports DataTable values from the external file. And if the file is opened in another program, ZAPTEST will throw run-time error and pause the test run I can change this behavior by defining a rule for the exception handler. On the Exception Handling dialog I press Add button From Triggers list I select All ZAPTEST Errors; I keep it applied to All Scripts; And for the action I choose Stop Execution. Now I will save the rule and run same test again. Test stops without displaying run-time error. And the test result includes step for the triggered Exception Handling Rule with status "Failed". In my second example I will define exception rule than will be triggered by specific error generated by ZAPTEST. In my test script I added reference to an object which does not exist in the Object Repository. During the test run ZAPTEST throws a run-time error and pauses script execution. I will add exception handling rule to ignore this kind of error. In the new rule configuration dialog I select "Specific ZAPTEST Error"; Enter partial text of the error; And for Action I choose Ignore and Continue. Now I will save the rule and run same test again. Test run completes without interruptions. And the test result includes step for the triggered Exception Handling Rule with status 'Warning". In my next example I will define Exception Handling rule to stop test execution if a test object is not found by ZAPTEST. I modified my test script by adding validation step for non-existent object During the test run ZAPTEST will report object not found error for the step, and continue test execution. If I want to stop my test when it fails to find any object, I need to define an Exception Handling rule. For Trigger I select "Object is not Found"; I leave empty object's name, so the rule applies to all objects; And choose Stop Execution for the Action. Now I will run same test again, and review results. The result includes step for the triggered Exception Handling Rule with status 'Failed". It also includes name of the object that was not found. In my next example I will demonstrate how to dismiss random pop-up dialogs. I created a test script to save content of my Notepad to a new file, When a file with the same name already exists, Save As displays confirmation dialog. I created a separate script to dismiss that dialog by clicking Yes button. In my main test script I also need to add Application Object for the pop-up dialog. In the new Exception Rule definition I select "Application Found" trigger type; Specify name of the pop-up application object; Choose Call Test for the Action; and use browse to include path to my second script. Now I will run my test and review results. The test result includes step for the triggered Exception Handling Rule with status "Warning", And steps of the second test that was called by the rule's action.

Contact Us

Tower Place 100

3340 Peachtree Rd NE #1800 

Atlanta, GA 30326 USA

(404) 814-5227