Hi Nikhil,
I checked this code in QTP11 it works.
can you tell me which version are you using,or is it license QTP or trial
there might be some problem in QTP version
Or Try This
bReturn=GetTableValue("4","5")
Function GetTableValue(iRows,iCols) 'Takes parameters as String
Redim arrReturn(Cint(iRows)*Cint(iCols)) 'try to convert all iRows and
iCols in Cint
'''' Other also convert in Cint format, whenever require only
End Function
I am not sure why its happening.
--
Thanks & Regards
Sujit :)
On Mon, Jul 9, 2012 at 9:37 PM, nikhil <[email protected]> wrote:
> Hi Sujit,
>
> Please see the code below:
>
> bReturn=GetTableValue(Rows,**Cols)
>
> Function GetTableValue(iRows,iCols)
> Redim arrReturn(iRows*iCols)
> Dim iRowCount ,iColCount,**iArrayIndex
>
> iArrayIndex=0
> For iRowCount = 0 to iRows-1
> For iColCount = 0 to iCols-1
> arrReturn(iArrayIndex) =Browser("MainBrowser").Page("**
> PgName").WebTable("tblName").**GetCellData(iRowCount,**iColCount)
> iArrayIndex=iArrayIndex+1
> Next
> Next
> GetTableValue=arrReturn
> End Function
>
>
> but QTP says invalid arguments when I'm calling the GetTableValue
> function. I'm passing just rowcount and colcount.
>
> Can u explain what the problem.
>
>
>
> On Wednesday, 20 June 2012 22:53:38 UTC+5:30, sujit wrote:
>
>> Hi Nikhil
>>
>> see function below
>>
>> Rows=2
>> Cols=7
>> ''all values stored in to Array bReturn
>>
>> bReturn=GetTableValue(Rows,**Cols)
>>
>> Function GetTableValue(iRows,iCols)
>> Redim arrReturn(iRows*iCols)
>> Dim iRowCount ,iColCount,**iArrayIndex
>>
>> iArrayIndex=0
>> For iRowCount = 0 to iRows-1
>> For iColCount = 0 to iCols-1
>> arrReturn(iArrayIndex) =Browser("MainBrowser").Page("**
>> PgName").WebTable("tblName").**GetCellData(iRowCount,**iColCount)
>> iArrayIndex=iArrayIndex+1
>> Next
>> Next
>> GetTableValue=arrReturn
>> End Function
>>
>> feel free to ask if you have any query :)
>>
>> --
>> Thanks & Regards
>> Sujit :)
>>
>> On Tue, Jun 19, 2012 at 11:59 PM, nikhil <[email protected]> wrote:
>>
>>> Hi I have a webtable with 2 rows and 7 columns. I need all the values.
>>> All these values
>>> need to be stored in an aray as I will be using these values to compare
>>> with others.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> "QTP - HP Quick Test Professional - Automated Software Testing"
>>> group.
>>> To post to this group, send email to [email protected]
>>> To unsubscribe from this group, send email to
>>> MercuryQTP+unsubscribe@**googlegroups.com<mercuryqtp%[email protected]>
>>> For more options, visit this group at
>>> http://groups.google.com/**group/MercuryQTP?hl=en<http://groups.google.com/group/MercuryQTP?hl=en>
>>>
>>
>>
>>
>> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en