Micro Focus QTP (UFT) Forums
script work too slow.. - 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: script work too slow.. (/Thread-script-work-too-slow)



script work too slow.. - jovik2003 - 06-23-2010

good day!
Help me please.

I have web page with big table (about 550 rows and 17 columns).
I want to put "inner text" of all cells of certain colum to DataTable.

At first I try to use this structure:
Code:
...
rn=1
For i = 2 To oWebTable.RowCount
    DataTable.SetCurrentRow(rn)
    DataTable.Value("A")=oWebTable.GetCellData(i,1)
    rn=rn+1
Next

it's work tooooooo slow Sad

then, I made function

Code:
Public Function getCellVal(byRef table, byRef col)

    set oTable = table.Object
    rn=1
    col = col-1

    For i=1 to table.rowcount-1
        set curCell=oTable.rows(i).cells(col)
        DataTable.SetCurrentRow(rn)
        
        DataTable.Value("A")=curCell.innertext
        
        rn=rn+1
        Next

End Function

It works about 5 minutes.
How can I force it to work faster?
..or, 5 minutes - it's normal time for QTP?

Thanks!