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 Table Row with text
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.
Get Cell Number Containing Text (given row)
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 Table Cell Count (given row)
Returns the count of number of columns (cells) in the given row of an HTML table.
Get Table Cell Text
Returns text from the given cell in the HTML table.
Get Table Row Count
Returns the row count from the given HTML table.
Verifying information
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 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 Cells in Table Row
Verifies the number of cells in a given row of an HTML table.
Verify Number of Table Rows
Verifies the number of rows in an HTML table.
Verify Table Cell Text
Verifies the text in a HTML table cell against an expected value.
Interacting with table cells and elements inside a cell
Click element in a table cell
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) Table Cell
Clicks (using JavaScript) in a given cell element of an HTML table. Row and Column numbering starts from 1.
Click Table Row
Clicks given row element in the HTML table. Row numbering starts from 1.
Click(JS) Table Row
Clicks (using JavaScript) given row element in the HTML table. Row numbering starts from 1.
Enter text in a table cell
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
Mouse Over Cell
Moves the mouse over to the given element
Select Item In Table Cell
Selects given dropdown item in the cell element in a HTML table.
Comments
0 comments
Please sign in to leave a comment.