Monday, August 11, 2008

Why QTP iterates for rows removed from the Data Table

If the user deletes a row from the data table using CTRL-X or the Delete key, QTP still runs an iteration for that row.
The DataTable contains four rows with data. The user uses the Delete key to delete the third and fourth rows. On replay, QTP still replays four iterations, even though he expects it to replay only two iterations. Why does this happen? The row was not deleted from the Data Table; only its contents were removed.
Each row in the table represents an iteration of the test script. You can see this in the Data Table. Any rows that are used for iterations have a black bottom grid line (instead of a gray grid line).
The CTRL-X and Delete keys remove the values from the cells in the row, but do not remove the rows (the grid line for the is still black).
If you want to prevent QTP from running an iteration on a row, you need to delete the entire row from the Data Table using the Edit -> Delete option (Ctrl+K). (This restores the bottom grid line from black to gray.)

No comments: