In order to get the count or total of all the numeric values in cells of a table, you can use XPath functions count and sum respectively. To implement this, use the Get_Web_Value command, set type to Number, and then use XPath functions of count or sum within the locator for this command. Here are 2 examples:
- GET_WEB_VALUE count LOCATOR application.page.cell.first NUMBER NA FALSE _
- application.page.cell.first is defined as count(//tr/td[1])
- This command gets the count of all of the numeric values in the first cells of each table row and assigns the result back to "count" variable.
- GET_WEB_VALUE total LOCATOR application.page.cell.total NUMBER NA FALSE _
- application.page.cell.first is defined as sum(//tr/td[1])
- This command calculates the total/sum of all the numeric values in the first cells of each table row and assigns the result back to "total" variable.
Comments
Please sign in to leave a comment.