Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Count and get the properties of different objects in a Java form
#1
Not Solved
Hi guys,

Can anyone help me with what I'm trying to do here? I'm trying to get the properties (developer name, attached text) of several objects (edit boxes, tables, buttons, etc.) from a Java application. Here's the code I'm using:

Code:
Function CreateObjectConfig(objWindow, strTblName, strObjectClass, strPage)

    Set getElement = Description.Create()
        getElement("Class Name").Value = strObjectClass
        getElement("micclass").Value = strObjectClass

    If strObjectClass = "JavaEdit" Then
        getElement("class description").value = "edit"
        getElement("toolkit class").value = "model.UIMaskedTextField"
    End If

    MsgBox objWindow.ChildObjects(getElement).count
    Set newObject = objWindow.ChildObjects(getElement)

    strFieldName = ""

    For ctrElement = 0 to getElement.Count - 1
        strDeveloperName = getElement(ctrElement).GetROProperty("developer name")

        If InStr(1, UCase(strObjectClass), "BUTTON") > 0 Then
            strAttachedText = newObject(ctrElement).GetROProperty("attached text")
        ElseIf InStr(1, UCase(strObjectClass), "EDIT") > 0 Then
            strAttachedText = newObject(ctrElement).GetROProperty("attached text")
        ElseIf InStr(1, UCase(strObjectClass), "EDIT") > 0 Then
            strAttachedText = newObject(ctrElement).GetROProperty("attached text")
        End If

        If Len(strAttachedText) = 0 or strAttachedText = "|" Then
            strAttachedText = "***"
        End If
    Next
...
End Function

The thing is, the objWindow.ChildObjects(getElement).Count always returns 0, even though I can access the objects in the form with descriptive programming (using the attached text and developer name as identifiers). Can anyone help me with the object description? I'm guessing that there's something wrong with how I described the objects that's why the ChildObjects() is returning a zero.

Also, what's the huge difference between using the micclass from Class Name? Oftentimes, micclass doesn't work when I'm using it for object descriptions, and Class Name just fits the bill...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  UFT unable to identify Java app objects consistently lester 1 2,040 07-12-2018, 08:28 PM
Last Post: Ankur
  Can we test Salesforce Standard form using QTP? yona34 0 1,077 05-22-2018, 10:57 AM
Last Post: yona34
  UFT not recogniziing Java Objects/ Elements YogeshCallappa 0 2,264 11-08-2016, 02:43 PM
Last Post: YogeshCallappa
Question Strange form, cant get it marvson 0 1,475 05-12-2016, 07:35 PM
Last Post: marvson
Shy Java Swing application objects identification issue kavithaminu 2 3,430 07-22-2015, 02:07 AM
Last Post: uftuser18

Forum Jump:


Users browsing this thread: 1 Guest(s)