What to do when my CUIT thows a PlaybackFailureException

Updated (Oct 11, 2011)

Problem:

I have a textbox that has a maximum length of five characters. I want to record a Data Driven CUIT to test that you cannot type in more than five characters.  However, when I attempt to set the textbox to a six character value the CUIT throws a PlaybackFailureException.

Solution:

Simply set Playback.PlaybackSettings.SkipSetPropertyVerification = true; before the call that throws the PlaybackFailureException and return it to false after.

Explanation:

After setting a property of any UI control, the record and playback engine performs a verification step to make sure that the set succeeded and the UI control now has the value it attempted to set it to.

For example if you have a text box that only allows 5 characters and you attempt to set it to 6 characters the engine will throw a PlaybackFailureException.

If you are trying to test that if I actually type 123456 that the value is 12345 you will have to set

Playback.PlaybackSettings.SkipSetPropertyVerification = true;

before your test attempts to fill in the value.

Comments are closed