Search code examples
functionhp-uft

UFT - Sending table to function


I'm sending table object to function, At the function i want to select a row from the table,

But when i'm openeing the operations list of the object I don't have the table operations (like SelectRow, SelectCell...)

This is the function call:

Dim tableObj

tableObj=JavaWindow(BankName).JavaInternalFrame("‪XXX").JavaTable("YYY")
CheckTblFieldValue(tableObj)

And this is the function body:

Public Function CheckTblFieldValue(tblObj)

      tblObj.SelectRow "#0"

Solution

  • You've fallen victim to one of VBScripts particularities, when assigning a variable with an object, you need to use the Set keyword. I duplicated your code for Web and got the same problem which was fixed by adding Set try:

    Set tableObj = JavaWindow(BankName).JavaInternalFrame("‪XXX").JavaTable("YYY")