Micro Focus QTP (UFT) Forums

Full Version: unable extract data from dynamic webtable
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi
I am automating a webapplication,
where i need to work on a web table which is unable another web table.
the web table is dynamic web table it is having more than 10 columns and in row it will display as per the data available.

but when i do the row count and columncount
Code:
browser().page().frame().webtable().rowcount
browser().page().frame().webtable().columncount(1)
it is displaying 4 rows and 2 columns
with getcelldata(2, 2)
it is displaying all columns
for ex: i am having col1, col2, col3, col4
getcelldata(2, 2) is displaying all the columns in a single location 2 row and 2 column col1, col2, col3, col4,
if i do the getcelldata(3, 2) all the data available in the table is displayed in the same location like below...
col1name1name2col2address1address2col3address3address4 etc

i want to clik on the checkbox in the firt column based on the data in the table.
There are three tables in a page
1. Item
2. Statement 1
3. Cashbook

statement and cashbook is within the Item table
when i spy any item in the statement table it will show the hirarchy will be
browser
.......page
..........module
................item
.......................Statement
.................................webelement


with GUI spy it is only showing the item and statement table and the webelement.

it is not showing the table underneth statement

Please find the attachment of web page
and the results of the statements of both the tables

Please help me is there solution ASAP.
Try using :

Code:
Browser().page().Webtable().ChildItem(1,1,"WebElement",0).getcelldata(row,column)

It worked for me.
Hi Amoghrane,

Your above code looks a bit strange to me !

Code:
Browser().page().Webtable().ChildItem(1,1,"WebElement",0)
-> this will return a WebElement from the cell(1,1) and once its retured you are using "GetCellData" method which infact is not applicable for "WebElement" Object class.

Hope you too agree with the above ?
Hi sreekanth ,

I got what u r saying but this is a working code that i have pasted above giving the expected results. I cannot explain how. I had tried it out because webtable().getcelldata() was giving all the values from the table.....Just try it out.