couple of days ago, was posted answer on the same question...
in Math.qfl
write a function
Func objFactory(name)
select (name)
Case "Maths":
objFactory = new Maths
exit func
Case ""other"
....
Endf
in qtp action call
onjMath = objFactory("Maths")
do call any "ExecuteFile" it is a bad habit, you will be never able to debug
the code
add this file to the test settings
On Tue, Mar 29, 2011 at 3:10 AM, Shalabh Dixit <[email protected]>wrote:
> Hi All,
>
> I created a function library math.qfl and in that i have created a
> Class with name "Maths". In the class I have created 2 functions
> Add_Numbers and Sub_numbers.. as follows:
>
> Class Maths
> Function Add_numbers(a,b)
> c=a+b
> msgbox c
> End Function
>
> Function sub_Numbers(a,b)
> c=a-b
> msgbox c
> End Function
> End Class
>
> Now When I assiciate this library with my test and try to access the
> class functions using the class objects, the list of functions in the
> class are not being displayed by QTP. i.e we need to manually type the
> full name of the functions:
>
> ExecuteFile (C:\TestLibrary\Math.qfl)
> Set objMaths=New Maths
> objMaths.Add_numbers(2,3)
>
> I want that when we type "objMaths." then all the functions in the
> class gets displayed by the qtp intellisense.
> Can anybody please help me in this.
>
> --
> 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