Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating an object via Function Library
#5
Solved: 11 Years, 3 Months, 4 Weeks ago
Solved it. Again, thanks sshukla12!

Code:
Public frmFlightReservation
Set frmFlightReservation = createDescription("Window", "Flight Reservation", "", "")

Code:
Public Function createDescription(typeObject, valProperty, auxProperty, auxPropertyVal)
    '================================================
    ' Description: Form object instantiation function
    '================================================
    ' Parameters:
    '    typeObject = MICClass/Class name of the Object
    '    valProperty = Value of the text/attached text
    '    auxProperty = Object's other specified optional property (Optional)
    '    auxPropertyVal = Value of the object's other specified optional property (Optional)
    '================================================
    ' Code START!

        Set objInst = Description.Create()

        objInst("micclass").Value = typeObject
    
        Select Case typeObject
            Case "Window":
                objInst("text").Value = valProperty
            Case "Dialog":
                objInst("text").Value = valProperty
            Case "WinComboBox":
                objInst("attached text").Value = valProperty
            Case "WinButton":
                objInst("text").Value = valProperty
            Case "WinRadioButton":
                objInst("text").Value = valProperty
            Case "WinEdit":
                objInst("attached text").Value = valProperty
            Case "WinList":
                objInst("attached text").Value = valProperty
        End Select
    
        If auxProperty <> "" And auxPropertyVal <> "" Then
            objInst(auxProperty).Value = auxPropertyVal
        End If
    
        Set createDescription = objInst
End Function
Reply


Messages In This Thread
RE: Creating an object via Function Library - by riechan - 06-22-2012, 01:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calling a function in a Test Script from a function library anupam4j 3 6,127 06-26-2015, 12:31 AM
Last Post: babu123
  Using QTP features in Function library TurtleRock 0 1,737 01-30-2014, 06:02 PM
Last Post: TurtleRock
  QTP is not recognizing Function Library Path associated to the test AshokReddy 2 4,105 12-19-2013, 01:59 PM
Last Post: AshokReddy
  Accessing Environment variable value in Library file vishruth143 1 2,572 09-07-2013, 05:11 AM
Last Post: jacosta
  Creating Random String SomeIntern 0 5,082 08-21-2013, 09:10 PM
Last Post: SomeIntern

Forum Jump:


Users browsing this thread: 2 Guest(s)