Forum Discussion

ThunduBeedi's avatar
ThunduBeedi
Occasional Contributor
9 years ago
Solved

What are the mandatory property or fields that a Java object/control should have?

Before calling GuiObject.getText, I want to make sure, the GuiObject is a Java GUI object. I am doing an aqObject.IsSupported(GuiObject, "getText"), but before this happens I want some checks.

 

Thank you.

  • Hi,

     

    As one of the possible solutions: use oGuiObject.Parent to recursively iterate up until the 'Sys' = oObject.Parent.Name and check if the oObject.Name is 'java', 'javaw', 'jplauncher' or something like this.

     

    Alternatively, you can parse oGuiObject.FullName and check if its process name is 'java', 'javaw', 'jplauncher', ...

  • All Java objects in TestComplete have the JavaClassName property.

     

    Also, the Name of Java GUI objects starts with SwingObject, AWTObject or SWTObject (depending on your application's UI framework).

3 Replies

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    All Java objects in TestComplete have the JavaClassName property.

     

    Also, the Name of Java GUI objects starts with SwingObject, AWTObject or SWTObject (depending on your application's UI framework).

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    As one of the possible solutions: use oGuiObject.Parent to recursively iterate up until the 'Sys' = oObject.Parent.Name and check if the oObject.Name is 'java', 'javaw', 'jplauncher' or something like this.

     

    Alternatively, you can parse oGuiObject.FullName and check if its process name is 'java', 'javaw', 'jplauncher', ...