Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

OnError method is not being invoked

OnError method is not being invoked

Problem:-

In Silk Test Workbench, when using the ‘On Error’ test step, error handling does not fire when an error is encountered, the script continues to execute. What can I do to resolve this?

 

Resolution:-

Please ensure that the ‘On Error’ test step is placed before the test step which is likely to cause an error else the ‘On Error’ method will not catch the error message and the associated actions to take will not be executed.

Please see the screenshot above which demonstrates the use of the On Error test step and that it is placed before step 4 which is will invoke an error. The sample application can be found at http://demo.borland.com/InsuranceWebExtJS/index.jsf

 

In the example, the first recorded step was to click the error labels that are displayed when the login button is clicked without entering a valid username or password.  Please see the screenshot below which shows the labels in question.

  1. As these labels do not exist when the page is first loaded, the test will fail with an object not found exception.
  2. The On Error test step is inserted before the test step likely to cause an error message.
  3. A label is inserted via the Insert -> Label menu to direct the script when the error is encountered, this is demonstrated in the first screenshot in step 6.
  4. The test steps proceeding the ‘Label’ test step enters the details into the username and password fields, followed by a click on the login button.

For more information on the ‘On Error’ test step please see the ‘On Error Go To Properties’ topic within the Silk Test Workbench Help.

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-10-31 22:39
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.