
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
UFT is not fetching the exact row count from webtable
I tried to fetch the row count from webtable having approximately 150 rows. however, while getting the row count it is displaying only 25. Below is the syntax i used.
1. rowcount=browser().page().webtable().rowcount
2. set Obj=browser().page().webtable()
rowcount= obj.rowcount


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
What does the table look like? Is it possible that there are 25 rows containing tables or multiple sub-rows?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello
Try this.
rc = Browser("brObj").Page("PgObj").WebTable("TblObj").rowcount
msgbox rc
set m = Browser("brObj").Page("PgObj").WebTable("TblObj").Object
msgbox m.rows.length

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi,
I have tried the same however, it is still fetching the same count. When ever we scroll down the data in the webtable starts fetching or loading.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
If the application only renders 25 rows at a time, you may need to capture the data you need from the first 25, scroll down, rinse and repeat.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi,
I have tried the same. However, it is not capturing the data. Could you please help me how can it be done.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Webtables will not be designed exactly like rows/columns for which it have data. Always developers will use lot of row/column elements to handle different scenarios, look & feel, etc.
So you should know if you are going to accept an row then it must contain some no of minimum cells which will display your values. Fetch the rows and filter based on cells count and operate.
intMinCells = 3 For intRow = 0 To Browser().Page().WebTable().Object.rows.length - 1 If Browser().Page().WebTable().Object.rows(intRow).cells.length > intMinCells Then 'Now handle the way you want msgbox Browser().Page().WebTable().Object.rows(intRow).cells(0).innerText 'If you need to click some element on a cell - But ensure 'native object's start index is 0 and for ChildItem starts with 1; you 'need to calculate the index based on the table design Browser().Page().WebTable().ChildItem(intRow, intCell, "WebButton", 0).Click End If Next
Thanks...
All the thoughts here are mine not related to my employer nor anyone.
Test Automation Ecstasy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Similar to the last post, I would do a reality check on the text in each row and see what is represented with each row, including any potential hidden rows.
nRows = Browser().Page().WebTable().RowCount
nCol = 1 ' assuming the text is in Column 1
For nRow = 1 to nRows
msgbox("Row = " & nRow & ". Text = " & Browser().Page().WebTable().GetCellData(nRow, nCol)
Next
Might need to include functionality for scrolling or clicking page numbers or "Next" etc. to get an even better picture.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
We can throw ideas at this, but it is tough without being able to see the table in question and evaluate its behavior.