Micro Focus QTP (UFT) Forums
Reading Editboxes in Table - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Reading Editboxes in Table (/Thread-Reading-Editboxes-in-Table)



Reading Editboxes in Table - Raj20091 - 07-08-2010

Hello,

I am trying to read values in edit boxes that are in a webtable.

There are 8 rows and 2 columns in the table, and each cell has an edit box. If I write a look to go from 1 to 8. The loop is looking at each row, instead of going through entire column.

My question is, how can I loop through the each column in a table before looping through the next column. Please see code below and the attachment.

Thanks,
Raj

Code:
Set a = Browser("Asset Price Verification").Page("Asset Price Verification").WebTable("Tiered Dealer Dispersion")

RowCount = a.GetROProperty("rows")
ColumnCount = a.GetROProperty("Cols")


Set oEdit = Description.Create()
oEdit("micclass").value = "WebEdit"

set Childobj = Browser("Asset Price Verification").Page("Asset Price Verification").WebTable("Tiered Dealer Dispersion").ChildObjects(oEdit)

    For j = 1 to RowCount

For i = 1 to ColumnCount

Next
            eValue = Childobj(j).GetRoProperty("value")
                IF eValue <>""  THEN

                    Reporter.ReportEvent 0, "All the data has be populated "&eValue, "Successful"
                                    ELSE

                    Reporter.ReportEvent 1, "All the data has NOT been populated "&eValue, "FAIL"
                                END IF

    Next
Next



RE: Reading Editboxes in Table - Saket - 07-09-2010

I think 'GetCellData' should work here, have you tried with this?

Code:
For i = 1 to RowCount
    For j = 1 to ColumnCount
        eValue = Browser("Asset Price Verification").Page("Asset Price Verification").WebTable("Tiered Dealer Dispersion").GetCellData(i,j)
    Next
Next



RE: Reading Editboxes in Table - Raj20091 - 07-09-2010

Saket: Thanks for the reply.

GetCellData, did not work. Not able to read data from edit boxes. Reading the data itself is not a issue. But reading the data in all the edit boxes is.

This is the issue, if the run the loop form i = 1 to 8 it is reading each row. Meaning, it is able to reach only until the 4th row. But I want to complete reading a column, before reading the next column.


RE: Reading Editboxes in Table - Arun Prakash - 07-10-2010

Hi,

First try to get the row number using orig year

Code:
intRowNum=Browser("").Page("").Frame("").WebTable("").GetRowWithCellText(pass the year)



Set objWebEdit=Browser("").Page("").Frame("").WebTable("").ChildItem(intRowNum,Coulumn,"WebEdit",index)
strText=objWebEdit.GetROProperty("innerText")
If we want the first web edit pass index as 0 and if we want the second one pass it as 1,
Put this code in a loop, i belive this will solve your problem.