UFT/QTP: Count child objects in Java Internal Frame

1.6k Views Asked by At

I need to compare a string with all values of my text fields that are inside in a Java Internal Frame.

I already tried to use this code:

Dim getElement
Set getElement = Description.Create
getElement("class description").value = "text box"

'I tried different class names: "OracleTextField", "JavaEdit"    
'getElement("micclass").value = "OracleTextField"
'getElement("micclass").value = "JavaEdit"

Set obj = Browser("xxxx").JavaApplet("Main").JavaInternalFrame("yyyy").ChildObjects(getElement)

total = obj.Count

' For loop goes here

total returns 0 all the time.

Can you tell me what I'm doing wrong? If you need something more let me know.

1

There are 1 best solutions below

0
On

I tried the following line and it works. Now i have total number of text fields available in Java internal frame.

getElement("to_class").value = "JavaEdit"

Following QTP documentation didn't help, but if you check your object properties inside your Object Repository you'll find all properties of each object. Instead of "micclass" try to use your property name. Mine was "to_class" with value "JavaEdit".

QTP Documentation explains why we should use "micclass" and differences between "micclass" and "Class Name". However none of them worked for me. I used "to_class" property and it works fine!

I'm working with UFT v12.02