Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP 9.2 .Net
#1
Not Solved
I am running QTP 9.2 with .net and ActiveX addins. The click in the code does not work consistently. When it errors, I get "object not found". Does anyone have any ideas on the problem?


Code:
Function fnClickKeyPadKey(strKeyName)

    Dim objswfWinDesc, objswfWinColl
    Dim objswfObjDesc, objswfObjColl
    strFound = False
    
    If Window(POS).Window(Keypad).Exist Then
        Set objswfWinDesc = Description.Create()
        objswfWinDesc("swftypename").Value = "FLIBCustomControlBridgeNet.ButtonWindow"

        Set objswfWinColl = Window(POS).Window(Keypad).ChildObjects(objswfWinDesc)
        For i = 0 to objswfWinColl.Count-1
            Set objswfObjDesc = Description.Create()
            objswfObjDesc("swftypename").Value = "FLIBCustomControlBridgeNet.ButtonControl"

            Set objswfObjColl = objswfWinColl(i).ChildObjects(objswfObjDesc)
            
            If objswfObjColl.Count = 1 Then
                strName = objswfObjColl(0).GetROProperty("text")
                strActualName = UCase(Replace(Replace(Replace(Trim(strName), VbCrLf, " "), VbTab, " "), " ", ""))
                strExpectedName = UCase(Replace(Replace(Replace(Trim(strKeyName), VbCrLf, " "), VbTab, " "), " ", ""))
            
                If  strActualName = strExpectedName  Then

                    objswfWinColl(i).Click 1, 1
            
                    strFound = True
                    Set objswfObjDesc = Nothing
                    Set objswfObjColl = Nothing
            
                    Exit For
              
                End If
                
            End If
            
            Set objswfObjDesc = Nothing
            Set objswfObjColl = Nothing
            
         Next

        If strFound Then
             fnClickKeyPadKey = True
        Else
            fnClickKeyPadKey = False
        End If
        
          Set objswfWinDesc = Nothing
          Set objswfWinColl = Nothing
   Else
        Print  "The Parent Object not found"            
    End If
    
End Function
Reply


Messages In This Thread
QTP 9.2 .Net - by sbonsteel - 06-06-2008, 12:15 AM
RE: QTP 9.2 .Net - by Amit Singh Chauhan - 06-12-2008, 02:22 PM
RE: QTP 9.2 .Net - by sbonsteel - 06-12-2008, 04:47 PM
RE: QTP 9.2 .Net - by Amit Singh Chauhan - 06-12-2008, 05:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP takes long time to click on asp.net forms arpan 0 1,923 10-16-2013, 09:30 PM
Last Post: arpan
  QTP is not identifying the objects in .net application. qtpexpert 0 2,698 03-12-2013, 12:59 PM
Last Post: qtpexpert
Exclamation .Net Addin for QTP 9.1(Urgent) shaam 1 3,196 07-15-2011, 07:28 PM
Last Post: Ankur
  Dot Net Factory Button click to run action in QTP nutsndips 1 4,479 06-21-2011, 08:37 PM
Last Post: nutsndips
  How QTP records context menu in .net GUI applications vanibandla 1 4,603 02-25-2011, 06:32 AM
Last Post: basanth27

Forum Jump:


Users browsing this thread: 3 Guest(s)