Jaganath,
You can use this code:

colCnt=Datatable.GetSheet(1).GetParameterCount
 For i = 1 To colCnt
  hdr = DataTable.GetSheet("Global").GetParameter(i).Name & "|"
  If len(hdr) > 2 Then
    ColTitles = ColTitles &
DataTable.GetSheet("Global").GetParameter(i).Name & "|"
  End If
    Next
 ColTitles = Mid(ColTitles,1,len(ColTitles)-1)
 hdrCnt = split(ColTitles,"|")
 'ActColCnt = UBound(hdrCnt)
 msgbox  UBound(hdrCnt) 'Actual Col count
Keep in mind, index value begins from 0. So total there are 4 columns.
Thanks,
Rahul

On Mon, Jun 22, 2009 at 5:20 AM, Jagannath Prasad Padhy
<[email protected]>wrote:

>
> Hi All,
> I am new to this group.
>
> I am using QTP 10.0 to automate our application. I have prepared a
> data driven framework where I am inputting my function name and
> paramater in the excel sheet and calling them in the run time. The
> columns and data are like as below,
>
> TestCase_Name | Function_Name | Parameter1 | Parameter2
> TC1                InsertProduct             150                 160
> TC2                InsertProduct             100                 110
>   120          130    140
>
> Same function could take different set of parameters as specified in
> the above example.
>
> I have used the following script to know the column count for a
> specified Function. But every time it returns me the column count as 7
> because in my second row there are 7 columns.
>
> Datatable.Import "D:\Automation\Test.xls"
> cnt=Datatable.GetRowCount
> i=1
> While i<=cnt
> i=i+1
> colcount=0
> colcount=Datatable.GetSheet(1).GetParameterCount
> msgbox colcount
> datatable.SetNextRow
> Wend
>
> Could you please let me know if there is any alternate way to find the
> column count?
>
> Regards,
> Jagannath
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to