HTML table is a common composite control you will find on web applications for display of data. ACCELQ supports comprehensive functionality related to automated test logic development on tables. You can dynamically parse tables, locate required rows & columns and also get a handle on elements that are part of the table cells.
This article describes most common commands useful when working with HTML tables.
Locating HTML table on View Canvas
An HTML table control is identified as Web Table in ACCELQ view analyzer. When you hover in the table area, View canvas highlights the entire table along with a tooltip displaying the cell number for the current cursor position. Row number and column number in the table are always referenced based on starting index 1. You can move around the cursor to review the cell numbers of various sections in the table.
Important Note: In all Web Table commands, row numbering and column numbering starts from 1. First row/column is indicated with 1. Table header is not distinguished from a table row. In other words, a table header, if it exists is considered as row #1, and hence the first data row will be considered row #2.
Finding Information from Table
Find row containing given text in web table
Scans an HTML table and finds a row dynamically based on a given matching criteria. Extensive array of options are available to setup expected match criteria. Here is a detailed article.
Find column containing given text in web table
Returns the column number (cell index) in the given row of an HTML table which contains required text. Returns -1 if the row does not have any cell that contains required text.
Get number of columns in web table
Returns the count of number of columns (cells) in the given row of an HTML table.
Get text from a cell in web table
Returns text from the given cell in the HTML table.
Get number of rows in web table
Returns the row count from the given HTML table.
Verify DB Query with Web Table
Compares information from a database query against the content of a table. Helpful when you have a grid in a web page rendered based on a query on DB. You can make direct verification of result from DB with front-end.
Verify element exists in Web Table cell
Verifies if a given element exists in the table cell. This element must already be defined in the Element Repository. Also, if the element is repeating in multiple cells in the table, make sure to set the element as a Repeat element.
Verify number of columns in web table
Verifies the number of cells in a given row of an HTML table.
Verify number of rows in web table
Verifies the number of rows in an HTML table.
Verify text in a cell in web table
Verifies the text in a HTML table cell against an expected value.
Interacting with table cells and elements inside a cell
Click a cell in web table
Clicks cell or an element (by HTML tag and instance) or given template (repeat) element in a table cell. Make sure to pass the element as a generic, repeatable element. Here is a detailed article
Click (JS) Web Table cell
Click Web Table row
Clicks given row element in the HTML table. Row numbering starts from 1.
Click (JS) Web Table row
Input text in a cell of web table
Enters text in cell or an element (by HTML tag and instance) or given template (repeat) element in the table cell. Make sure to pass the element as a generic, repeatable element. Here is a detailed article
Hover on a cell in web table
Moves the mouse over to the given element
Select item in Web Table cell
Selects given dropdown item in the cell element in a HTML table.