Creating HTML table checkpoints

QA Wizard Pro can perform control and exists checkpoints on HTML tables, table cells, and controls in cells. Control checkpoints verify properties of a table or contents of a specific table cell against an expected value. For example, you can verify that a table has a specific number of rows and columns. Exists checkpoints verify that a table or control in a table exists. For example, you can verify that a button is included in a table cell. See Creating checkpoints and Creating exists checkpoints.

Note: You can also create checkpoints for HTML tables during recording. See Creating record-time checkpoints and Creating record-time check exists checkpoints.

When you create a control checkpoint in an HTML table, you need to identify search criteria to locate the control. QA Wizard Pro uses this criteria during playback to search the table for the control to check. The search criteria is identified in the GetControlFromTable statement, which is used in place of the control name in checkpoints. See Using the GetControlFromTable statement. QA Wizard Pro automatically adds the GetControlFromTable statement to checkpoints in the Add Statement dialog box, but you can also add it when modifying scripts in Text View.

Note: You may need to use multiple GetControlFromTable statements to add checkpoints for nested HTML tables. See Testing nested HTML tables.

1. Select the script line above where to add the statement.

2. Choose Script > Add Statement.

The Add Statement dialog box opens.

3. Select Checkpoint or Check Exists in the Checkpoint category.

4. The Application/version field is automatically set with the context. This information is used to populate the Window and Control fields on the Add Statement dialog box with values from the application repository. See Script.SetContext.

If QA Wizard Pro cannot identify the context, None is selected. This usually occurs when you add statements to a utility script that is only called by other scripts because the context is set in the script that calls it. If an application/version is required, select it from the list.

5. Select the Window that includes the table.

A screenshot of the selected window is displayed.

6. Select the table as the Control.

The selected table is outlined with a red box in the screenshot.

7. Click Table Data to select the control search criteria.

The Child Control Search Criteria dialog box opens.

8. Enter the Row Index and Column Index to search.

You can use integers, script variables, or the ANYROW and ANYCOLUMN constant variables, which search all rows and columns in the table. The index of the first table row and column is 1.

Note: If the table is dynamic, use the GetColumnFromRowIndex or GetRowFromColumnIndex statements to find the row index or column index during playback. See Finding HTML table row and column index values.

9. Select the Control Type to search for.

The HTMLElement control type can be used to search for table cells or other HTML elements, such as <div> tags, that are not recognized as controls.

10. Select a Property, Action, and Expected Value to use to identify the control.

A control must be unique for QA Wizard Pro to differentiate it from other controls in the table. Select at least one property if the table includes more than one instance of the selected control type. See Modifying window and control properties for information about configuring control search criteria.

Tip: Selecting the Tag ID property generally helps refine the search for the control.

11. Select any additional properties to perform a more specific search.

12. Click OK.

A summary of the search criteria is displayed in the Child Control Search Criteria field.

13. If you are creating a context menu item checkpoint, select Context Menu Item. See Testing context menus.

14. If you are adding a control checkpoint, select the Property to check from the list. You can use a text string, constant, expression, datasheet column value, variable, or function that returns the value.

15. If you are adding a control checkpoint, enter or select the Expected Value to compare against the actual value. You can use a text string, expression, datasheet column value, variable, or function that returns the value.

16. Expand the Advanced options to indicate what happens if the checkpoint fails.

17. Enter an optional Comment, such as the purpose of the statement.

18. Click OK to add the statement to the script.