Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GetCellData syntax
#1
Not Solved
Hi guys,

I'm a relatively new to QTP and VBscript. I'm having problem with the following script:


Code:
Dim myarray()
arrayLength = JavaWindow("M1").JavaInternalFrame("Inventory").JavaTable("Inventory").GetROProperty("rows")
Redim myarray(arrayLength)

For i = 1 to arrayLength
    myarray(i) = JavaWindow("M1").JavaInternalFrame("Inventory").JavaTable("Inventory").GetCellData(i, "Name")
Next

I'll get the following error when executed:

The statement contains one or more invalid function arguments.

Line (15): "myarray(i) = JavaWindow("M1").JavaInternalFrame("Inventory").JavaTable("Inventory").GetCellData(i, "Name")".


But if I were to set the variable value for "i" manually like so:

Code:
myarray(0) = JavaWindow("M1").JavaInternalFrame("Inventory").JavaTable("Inventory").GetCellData(0, "Name")
myarray(1) = JavaWindow("M1").JavaInternalFrame("Inventory").JavaTable("Inventory").GetCellData(1, "Name")
myarray(2) = JavaWindow("M1").JavaInternalFrame("Inventory").JavaTable("Inventory").GetCellData(2, "Name")

I'll be able to store the value in myarray.

What's wrong with using "i" as parameter argument for GetCellData?

Am I doing something wrong? Please advise.

Thanks.
Reply
#2
Not Solved
Hi, The Syntax of GetCellData is

Code:
var_GetCellData = swfWindow("myWindow").swfTable("myTable").GetCellData(Row, Column)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  System Utility Syntax chita26 1 4,999 11-04-2014, 12:41 PM
Last Post: vinod123
  Webtable().GetCellData() Returns hidden values of Cells ssvali 4 6,092 06-07-2013, 08:37 PM
Last Post: kawsar
  Syntax with descriptive programming martinshort 9 11,622 05-15-2013, 08:39 PM
Last Post: martinshort
  QTP - Webtable().GetCellData() returns unknown symbols and spaces lokesh8008 2 4,853 05-10-2013, 03:49 AM
Last Post: sria123
  Syntax of SystemUtil.Run vijay.gupta 6 78,382 08-21-2012, 04:57 PM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)