• RSS
  • Facebook
  • Twitter

One Center for all the Testing Need. OneTestingCenter is for all, for all QA, for all Automation. Automation is easy, fun and enriching experience. Happy Learning and Happy Testing!

  • Access to All QA

    At OneTestingCenter, you find lots of books,articles,blogs and detailed guides. Everyone has access to QA. Happy Learning, Happy Testing.

  • Global Trainings

    All the QA/Auotmation trainings are available at OneTestingCenter. QA, Automation, QTP/UFT, Selenium, LoadRunner, QC/ALM, Appium...

  • Automation Learning Fun

    Technology is always evolving. Automation is always challenging. To be frank, Automation is fun, enthusiastic and enrching experience.

    '***************************************************************************
    ' Get Value Property 
    '***************************************************************************
    ' Return the object 'Value' property
    'Description Returns the Object value

    Public Function GetValueProperty (obj)
       GetValueProperty = obj.GetROProperty("value")
    End Function
    '***************************************************************************
    ' Get Text Property
    '***************************************************************************
    ' Return the object 'Text' property
    'Description Returns the Object value

    Public Function GetTextProperty (obj)
       GetTextProperty = obj.GetROProperty("text")
    End Function
    '***************************************************************************
    ' Get Attached  TextTProperty
    '***************************************************************************
    ' Return the object 'attached text' property
    'Description Returns the Object  attached text

    Public Function GetAttachedTextProperty (obj)
       GetAttachedTextProperty = obj.GetROProperty("attached text")
    End Function
    '***************************************************************************
    ' Get Selection Property
    '***************************************************************************
    ' Return the object 'selection' property
    'Description Returns the Object value

    Public Function GetSelectionProperty (obj)
       GetSelectionProperty = obj.GetROProperty("selection")
    End Function
    '***************************************************************************
    ' Get Checked Property
    '***************************************************************************
    ' Return the object 'checked' property
    'Description Returns the Object value

    Public Function GetCheckedProperty (obj)
       GetCheckedProperty = obj.GetROProperty("checked")
    End Function
    '***************************************************************************
    ' Get Nativeclass Property
    '***************************************************************************
    ' Return the object 'nativeclass property
    'Description Returns the Object  nativeclass

    Public Function GetNativeclassProperty (obj)
       GetNativeclassProperty = obj.GetROProperty("nativeclass")
    End Function
    '****************************************************************************
    ' A Sample script  to invoke Filght App and to make use of the above functions
    'This script calls the above functiolns and in return gets the object properties
    '****************************************************************************

    SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe"
    wait(2)
    Dialog("Login").Activate
    Dialog("Login").WinEdit("Agent Name:").Set "GAReddy"

    'To get the  Text Property of the  WinEdit AgentName field
    Set obj=Dialog("Login").WinEdit("Agent Name:")
    Print "Nativeclass Property  of the Object ( Agent Name:)  is -->   " & GetNativeclassProperty (obj)
    Print "Text Property  of the Object ( Agent Name:)  is -->      " & GetTextProperty (obj)
    Print "AttachedText Property  of the Object ( Agent Name:)  is --> " & GetAttachedTextProperty (obj)

    Dialog("Login").WinEdit("Password:").Set "MERCURY"

    'To get the  Text Property of the  WinButton OK field
    Set obj=Dialog("Login").WinButton("OK")
    Print "Nativeclass Property  of the Object ( OK)  is -->  " & GetNativeclassProperty (obj)
    Print "Text Property  of the Object (OK)  is -->        " & GetTextProperty (obj)

    Dialog("Login").WinButton("OK").Click
    ''*********************************************************************************


    Reactions:

    QTP - Getting Object Properties Dynamically

    '***************************************************************************
    ' Get Value Property 
    '***************************************************************************
    ' Return the object 'Value' property
    'Description Returns the Object value

    Public Function GetValueProperty (obj)
       GetValueProperty = obj.GetROProperty("value")
    End Function
    '***************************************************************************
    ' Get Text Property
    '***************************************************************************
    ' Return the object 'Text' property
    'Description Returns the Object value

    Public Function GetTextProperty (obj)
       GetTextProperty = obj.GetROProperty("text")
    End Function
    '***************************************************************************
    ' Get Attached  TextTProperty
    '***************************************************************************
    ' Return the object 'attached text' property
    'Description Returns the Object  attached text

    Public Function GetAttachedTextProperty (obj)
       GetAttachedTextProperty = obj.GetROProperty("attached text")
    End Function
    '***************************************************************************
    ' Get Selection Property
    '***************************************************************************
    ' Return the object 'selection' property
    'Description Returns the Object value

    Public Function GetSelectionProperty (obj)
       GetSelectionProperty = obj.GetROProperty("selection")
    End Function
    '***************************************************************************
    ' Get Checked Property
    '***************************************************************************
    ' Return the object 'checked' property
    'Description Returns the Object value

    Public Function GetCheckedProperty (obj)
       GetCheckedProperty = obj.GetROProperty("checked")
    End Function
    '***************************************************************************
    ' Get Nativeclass Property
    '***************************************************************************
    ' Return the object 'nativeclass property
    'Description Returns the Object  nativeclass

    Public Function GetNativeclassProperty (obj)
       GetNativeclassProperty = obj.GetROProperty("nativeclass")
    End Function
    '****************************************************************************
    ' A Sample script  to invoke Filght App and to make use of the above functions
    'This script calls the above functiolns and in return gets the object properties
    '****************************************************************************

    SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe"
    wait(2)
    Dialog("Login").Activate
    Dialog("Login").WinEdit("Agent Name:").Set "GAReddy"

    'To get the  Text Property of the  WinEdit AgentName field
    Set obj=Dialog("Login").WinEdit("Agent Name:")
    Print "Nativeclass Property  of the Object ( Agent Name:)  is -->   " & GetNativeclassProperty (obj)
    Print "Text Property  of the Object ( Agent Name:)  is -->      " & GetTextProperty (obj)
    Print "AttachedText Property  of the Object ( Agent Name:)  is --> " & GetAttachedTextProperty (obj)

    Dialog("Login").WinEdit("Password:").Set "MERCURY"

    'To get the  Text Property of the  WinButton OK field
    Set obj=Dialog("Login").WinButton("OK")
    Print "Nativeclass Property  of the Object ( OK)  is -->  " & GetNativeclassProperty (obj)
    Print "Text Property  of the Object (OK)  is -->        " & GetTextProperty (obj)

    Dialog("Login").WinButton("OK").Click
    ''*********************************************************************************