Clicking a table cell can get tricky at times, and multiple options may be available. ACCELQ supports an array of command configurations to handle even the most complex requirements in table cell operations.
Command name: Click a cell in web table
Element Spec is an important option in this command which allows configuring the type of click happening in the table cell. This option takes 3 possible values:
- In table cell : Clicks in a given cell specified by the row number and column number.
- An element in table cell: Clicks on an html element inside a given cell. HTML element is identified by the HTML tag and instance number. For example, you can use this option to click a check-box inside a table cell. All you need to provide is the HTML tag of the element you are interested in. e.g. "input".
- A template element in table cell: You can freely specify an element structure, which needs to be clicked in the table cell. Useful for more complex table setups where there may be multiple clickable elements inside a table cell. In this case, you will save a generic element in the Element Repository and use it to identify the template.
Here is the complete listing of options you can provide while configuring this command in your logic.
Note: Row numbers and column numbers specified in various HTML table commands start from 1. In other words, first row is indicated as '1', not '0'. Also, the header row is considered to be a row on its own, so be sure to add an extra row in case there is a header in the table.
1. Following snippet clicks second cell of first row in savings table.
2. Following snippet clicks, first HTML link (anchor element) in second cell of first row in savings table.
3. Following snippet clicks on button element in first cell of second row in savings table. Note that button element is an element from the Element Repository.
Note: When you are interested to click on a specific element inside an HTML table, it is advisable to use a tag based or template element based approach to ensure the click event is properly handled. Click based on just row number and column number may not always succeed in raising the click event correctly.
Please sign in to leave a comment.