Forum Discussion

npathak's avatar
npathak
Occasional Contributor
13 years ago

Encountered java.awt.IllegalComponentStateException in TestComplete...

Hi,



I am new to TC.

I encountered an error in TC, the error exception is " java.awt.IllegalComponentStateException".

Please find the image for more details.



Left view in "New.png" image is the image of my application, which is a desktop based application developed in "java".

Right side view is the image of object browser for child of "GALAXIES" tree view.



Let me explain my application:

As attached image suggests, we could have muliplte galaxies( currently it has only one, which is "Galaxy1") , 

Each Galaxy should have "My Family" , "My Family Data" & "My Friends" .

Its a tree structure . "My Family Data" exist inside "MY family" . "My family" &  "My Friends"   are at the same level of tree.

"My Family Data" & "My Friends" may contain any number of "folder" type objects.





So, the problem is, I am not able to find my "My Galaxy1" object in "Galaxies" tree view.

I am able to find "Galaxies" Panel as object using "object Spy" or "Object Browser" But all other objects are NOT accessible ( neither thru object spy nor thru object browser ). Hence, I can't click on them.

When you refer the "New2" image, you can find that object property "visible" & "visible on screen" is false.





NOTE: When I use the "Record Script" functionality in TC, am able to click on all tree view objects & Playback works fine.

BUT, I want to click on that object & that too using script, NOT thru record & playback functionality.



Please let me know if am missing something.



Thanks,

Naval

3 Replies

  • Julia_K's avatar
    Julia_K
    SmartBear Alumni (Retired)

    Hello Naval,

    The Object Browser and Object Spy do not display child items of tree view controls in Java applications. That is why you cannot find the "My Galaxy1" item of the "Galaxies" tree view in the Object Browser.

    To access child items of your "Galaxies" tree view control, please use the wItems property that returns a collection of the tree view's child items.

    For detailed information on how to work with tree view controls and their child items, please see the Working with Tree View Controls Help topic.


    Please let us know whether this information helps you or whether you have any additional questions.

    Thank you.

  • npathak's avatar
    npathak
    Occasional Contributor
    Thanks Julia,



    But, "wItems" didn't work for me. Also, I went thru your article called "Addressing Tree Views" ( available at http://smartbear.com/support/viewarticle/15099/ ) but that too didn't work in my favour.

    I know am missing something, don't know what.



    Below is the piece of code I used:



        Repository_Tree_Prop_array = Array("JavaClassName")



        Repository_Tree_Values_array = Array("RepositoryTree")


        Set Repository_Tree = MY_Process.FindChild(Repository_Tree_Prop_array,Repository_Tree_Values_array,20)


        Repository_Tree.wItems.Item("My Galaxy1").Click()  

        Repository_Tree.wItems.Item("|My Galaxy1").Click()  'I tried with this option also, but it didn't work.




    Error encountered in logs:



    Unable to find the object wItems. See Additional Information for details.



    Also,

    "wItems" method not found in object browser.



    Please let me know what needs to be done in this case.
  • Julia_K's avatar
    Julia_K
    SmartBear Alumni (Retired)
    Hello Naval,

    Could you please check whether the SwingObject("RepositoryTree", "", 0) object of your application has the wItems property in the Object Browser?

    If the property is missing from the object's property list in the Object Browser, please follow the instructions below:

    If you are using a custom class (other than javax.swing.JTree) for your tree control, please make sure that the full name of the control's class is added to the Swing Controls | Tree group of your project's Object Mapping options. To learn how to do this, please see the Recognizing Custom Controls section of the JTree Object Help topic.

    If this still does not help, could you please use this web form to send your application or a sample application that demonstrates the problem to our Support Team? This will help us analyze your problem faster.

    Thanks in advance.