Monday, January 20, 2014

The old True, False, NULL problem

Say you've got an application where a new check box was added to the screen and a new column was added to the table. The possible values of the check box are are True and False. Maybe the existing rows in the table are set to NULL when the new column is added.

Are existing rows updated?

Does the column have a default value?

Does the application break on rows where the column is set to NULL?

I think existing rows should be set to True or False, but sometimes they're not.

It seems confusing if NULL is being interpreted as True or False.

Just something to check for.

Thursday, January 2, 2014

CodedUI test - check for existence of dialog

If the application has a dialog that is only displayed in certain cases you can write a custom method to execute commands when the dialog exists. This application has a dialog that is only displayed if an add-in could not be loaded.

Execute certain commands when dialog exists:

1. Record the assertion and action on the dialog.

2. Write a new method in UIMap.cs to check for existence of the dialog and execute the recorded assertion and the recorded action.

3. Move calls to the recorded assertion and recorded action from CodedUITest.cs to new method in UIMap.cs.

if (dialog.Exists)

4. Add a using statement to UIMap.cs for Microsoft.VisualStudio.TestTools.UITesting.WinControls:

5. Call the custom method from CodedUITest.cs in place of the recorded assertion and the recorded method.