• 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.

    Verify Object Is Enabled or Disabled

    '*********************************************************************
    ' Verify Object Is Enabled  
    '*********************************************************************

    ' Pass a object to the function VerifyEnabled to ve verified
    'Parameters: 
    ' obj - Object which is to be verified for enabled property

    Public Function VerifyEnabled (obj)
       Dim enable_property
       'Get the enabled property from the test object
       enable_property = obj.GetROProperty("enabled")
       If enable_property <> 0 Then ' The value is True (anything but 0)
         Reporter.ReportEvent micPass, "VerifyEnabled Succeeded", "The test object is enabled"
         VerifyEnabled = True
       Else
         Reporter.ReportEvent micFail, "VerifyEnabled Failed", "The test object is NOT enabled"
         VerifyEnabled = False
       End If
    End Function 

    '*********************************************************************
    ' Verify Object Is Disabled 
    '*********************************************************************

    '' Pass a object to the function VerifyDisabled to be verified
    'Parameters: 
    ' obj - Object which is to be verified for enabled property

    Public Function VerifyDisabled (obj)
       Dim enable_property
       'Get the enabled property from the test object
       enable_property = obj.GetROProperty("disabled")
       If enable_property = 0 Then ' The value is False (0) - Enabled
         Reporter.ReportEvent micPass, "VerifyDisabled Succeeded", "The test object is disabled"
         VerifyDisabled = True
       Else
         Reporter.ReportEvent micFail, "VerifyDisabled Failed", "The test object is enabled"
         VerifyDisabled = False
       End If
    End Function


    '*********************************************************************
    ' ' Actual code begins here.
    '*********************************************************************
    ' To check if the Button is enabled or not.
    ' If enabled then call another function (ClickOnButton to click on Button )

    Set Obj=Browser("").Page("").WebButton("")
    If VerifyEnabled(Obj)=True Then
        Call ClickOnButton(Obj)
    End If 
    Reactions:

    QTP - Verify if an object is enabled or disabled

    Verify Object Is Enabled or Disabled

    '*********************************************************************
    ' Verify Object Is Enabled  
    '*********************************************************************

    ' Pass a object to the function VerifyEnabled to ve verified
    'Parameters: 
    ' obj - Object which is to be verified for enabled property

    Public Function VerifyEnabled (obj)
       Dim enable_property
       'Get the enabled property from the test object
       enable_property = obj.GetROProperty("enabled")
       If enable_property <> 0 Then ' The value is True (anything but 0)
         Reporter.ReportEvent micPass, "VerifyEnabled Succeeded", "The test object is enabled"
         VerifyEnabled = True
       Else
         Reporter.ReportEvent micFail, "VerifyEnabled Failed", "The test object is NOT enabled"
         VerifyEnabled = False
       End If
    End Function 

    '*********************************************************************
    ' Verify Object Is Disabled 
    '*********************************************************************

    '' Pass a object to the function VerifyDisabled to be verified
    'Parameters: 
    ' obj - Object which is to be verified for enabled property

    Public Function VerifyDisabled (obj)
       Dim enable_property
       'Get the enabled property from the test object
       enable_property = obj.GetROProperty("disabled")
       If enable_property = 0 Then ' The value is False (0) - Enabled
         Reporter.ReportEvent micPass, "VerifyDisabled Succeeded", "The test object is disabled"
         VerifyDisabled = True
       Else
         Reporter.ReportEvent micFail, "VerifyDisabled Failed", "The test object is enabled"
         VerifyDisabled = False
       End If
    End Function


    '*********************************************************************
    ' ' Actual code begins here.
    '*********************************************************************
    ' To check if the Button is enabled or not.
    ' If enabled then call another function (ClickOnButton to click on Button )

    Set Obj=Browser("").Page("").WebButton("")
    If VerifyEnabled(Obj)=True Then
        Call ClickOnButton(Obj)
    End If