Playback Exception in VSTS2010

Exceptions & what they mean

Playback on IE or Mozilla Firefox can fail due to various reasons and the playback engine throws the best exception out of a variety of playback exceptions for the user to root cause the reason for the failure.

Recording Failures

Possible Exception Cause Comment
TechnologyNotSupportedException Recording on a unsupported technology App If the user tries to record on applications on IE whose version is below 7 or on 64-bit IE or on Mozilla Firefox, the recorder throws a technology supported exception.

Playback failures

Playback does two major things in order to perform action on the control search and action on the control. Following are the possible reasons and their exceptions.
First Rule for troubleshooting Mozilla Firefox playback issues: Whenever there is a playback failure in Mozilla Firefox, do a playback of the same recording on IE. If the playback fails in IE also, follow the troubleshooting tips in the IE user guide located here to root cause the issue. If the playback succeeds in IE but fails in Mozilla Firefox , follow the comments mentioned below depending on the type of exception being thrown.
Following are some of the suggested tips to debug the search failure during playback.
  • See screenshot (stored in %temp%\uitestlogs\lastrun if logs are enabled) to see whether the control was actually visible or not.
  • Verify the search properties and UI hierarchy (QueryID) using Firebug.

Possible Exception Cause Comment
UITestControlNotFoundException The control does not exist or search properties are not enough to find the control. Use the Firebug tool to see whether the search properties are correct and make sure if the control can be found. If control exists in the Mozilla FireFox document then check whether the DOM hierarchy of the control is same in both IE & Mozilla FireFox. For more information on DOM Hierarchy mismatch refer to 2nd Point in the ‘Known Issues – Issues in Mozilla FireFox Playback’ section.
UITestControlNotAvailableException The control does not exist in the app now. Whenever the playback performs an action on a control, it is cached for future references. When the playback tries to act on this cached control which is no longer available, the playback throws this exception.
Action Failure
Sometime though the search passes but the playback may not be able to do the action on the control. Following may be the possible reason/tips to debug the issue
  • Verify using Firebug Toolbar whether, is there any other control with the same properties under the parent mentioned in the QueryID. Some time there may be more than one control with the same properties under a parent hence during playback the first control will be selected and the action may fail on it. User can work around it after adding the instance property in the code for the ambiguous control.
  • User can use .DrawHighLight() method to actually see which control is chosen for the UITestAction. This method is available for all the UITestControl and will draw a rectangular highlighter around the control.
  • Verify whether the control state is same as it was during recording e.g., SetValue was recorded on a text box but during playback the text box is read only.

Possible Exception Cause Comment/Possible workarounds
ActionNotSupportedOnDisabledControlException Playback is trying to perform action on a disabled control This is thrown when the playback try to do some action on the disabled control/read only controls. Following are some of the cases:
· SetValue on a read only combobox/text box
· Click/SetState on disabled buttons/checkboxes
FailedToPerformActionOnHiddenControlException When the playback tries to act on a control which is present but is not visible The control cannot be visible when we set the CSS styles of the control to be hidden. The user has to make the control visible before the playback can perform any action on it.
FailedToPerformActionOnBlockedControlException The control exists but not actionable Thrown when a control is blocked in this case though the search passes but the required action will not be played back. Following might be some of the causes for this exception
· The control is not visible in the view port and not scrollable even
· Control is blocked due to some modal dialog on top of it
DecodingFailedException May come in password text box When the decoding of encrypted password fails due to incorrect key value.
PlaybackFailureException Default fall back exception for uncategorized issues For any other failure the playback engine would throw PlaybackFailureException. For example if Get/Set of some property fails for a control playback engine would throw PlaybackFailureException.

Post a Comment


Close Menu