Wednesday, April 15, 2020

Error Handling in Test complete

Error Handling in Test complete
  • Errors can be occurs due to script code or application under the test, which needs to handle.
  • Testcomplete doesn’t provide any specific methods at own, but support statements supported by the scripting language.
  • Jscript, javascript,c++, C# - try catch and finally block
  • VB Script- Err object and On Err statement
    • Err.ClearErr.NumberErr.Description
    • On Error Resume next – if error occurs, test complete continue running the script rather than stop it
    • On error go to 0 – to cancel the effect of on error go to next use this
    • On error go to linenum
  • Record-time and design-time actions can notify a user about errors using the aqDlg.ShowError or aqDlg.MessageDlg methods
  • Use the Log.Error or Log.Warning method to post an error or warning message to the test log

Possible error like object not found, name mapping found or something like that.
The object didn’t exist at the time TestComplete tried to obtain it.
The object’s identification properties changed.
Click Accept Intelligent Fix to update recognition attributes
Click Intelligent Fix to view and update recognition attributes
Click View and change to view recognition attributes
The object’s position in the object tree was changed.
One of the parent objects causes the ambiguous recognition problem.
The tested process was not found.
The alias refers to a mapped object that is not in the NameMapping project item.
The tested application stopped responding.
The object tree model differs from the model that was used to create the test.
Below are typical causes of the problem and typical ways to eliminate them.
Cross-platform web tests: There is no object that matches the specified search expression
Handling the 'Unable to Find the Object' error in TestComplete: Name of the object over which the operation simulates user actions
Handling the 'Unable to Find the Object' error in TestComplete: Selecting available locators on a keyword test
Handling the 'Unable to Find the Object' error in TestComplete: Viewing the object name in the Object Spy
Handling the 'Unable to Find the Object' error in TestComplete: Viewing available locators in the Object Spy
Handling the 'Unable to Find the Object' error in TestComplete: Viewing the object name in the Object Browser
Handling the 'Unable to Find the Object' error in TestComplete: Viewing available locators in the Object Browser
The object name is misprinted.
The object name has changed.
The object’s position in the object tree was changed.
The object has not been created by the time TestComplete tries to obtain it.
The tested application stopped responding.
The object tree model differs from the model that was used to create the test.
Below are typical causes of the problem and typical ways to eliminate them.
The window class name, caption or index is misprinted.
The window caption (text), class name or index has changed.
The object’s position in the object tree was changed.
The object has not been created by the time TestComplete tries to obtain it.
The tested application stopped responding.
The object tree model differs from the model that was used to create the test.


Log operations
Log.messageLog.Message(MessageTextAdditionalInformationPriorityAttrPictureFolderID)
Log.error(Log.Error(MessageTextAdditionalInformationPriorityAttrPictureFolderID)
Log.picture
Log.EventLog.Event(MessageTextAdditionalInformationPriorityAttrPictureFolderID)
Log.warning(Log.Warning(MessageTextAdditionalInformationPriorityAttrPictureFolderID)

No comments:

Post a Comment