Forum Discussion

bistritapcv's avatar
bistritapcv
Contributor
5 years ago

file selection

Here is another question, if you don't mind.

There is a Windows application with a toolbar across that has File  Search  Help.

(see attachment).

 

I want to select something from "File" (but to avoid giving proprietary information I am going to ask about selecting from "Help" which is the same principal).


See the second attached.  I am able to successfully click "File" (and therefore "Help") by using

["SwingObject"]("JMenuBar", "File", 0) or ["SwingObject"]("JMenuBar", "File", 0), but then when I try to use the object spy I can't clicki it without the menu closing again so the sub menus are not there.

Is there some way to keep a menu open, or otherwise determine the value of the field?  And not, selecting preferences will bring yet another menu which I need to access.  (And I am really selecting from file, but we might have confidential information there).

 

(This is Connect and C#)

 

 

10 Replies

    • bistritapcv's avatar
      bistritapcv
      Contributor

      Thanks, but the problem is I can't get a more detailed view.  It just gives a larger red frame, and I can't select anything inside, either with the spy or point and click.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        While recording a test fully is not something that is usually recommended up here, using the "record" feature of TestComplete to examine how a component is interacted with or how TestComplete "sees" things is CERTAINLY a good way.

         

        So... what do you get in TC when you record clicking on the particular component and menu options?  How does it turn out?  Maybe that will reveal to you how to go about the selecting the menus you want.

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Well... Based on your last screenshot:
    -- Are you using Connected application with TestComplete or TestLeft?

    Note, that Connected applications in TestComplete are depricated in favor of TestLeft.

    Initial idea of Connected applications was to create self-tested application. I.e. such application calls its own methods from within its own code (thus having full access to all objects and data structures that can be accessed from code within the application itself) and that uses TestComplete mostly just as a reporting engine (Test Log).

    With this in mind, I am not sure that C# code that your application is created with has any access to Java Swing objects and data structures that you'd like to interact with.

    So, if you are using TestComplete and unless you need Connected application for some reason, I would recommend to try regular test and check if TestComplete itself can identify and interact with both your C# application and Swing part.

     

    • bistritapcv's avatar
      bistritapcv
      Contributor

      Yes, test complete.  Ad yeah, I know, Test Left is taking over ;-)  But I have to go with decisions made above my level.  I do use Object Spy in Test Complete to try to identify objects.

       

      Even though I can't use now, I want to read a bit of Test Left to see how it works.  I have trouble figuring out the syntax of Connect anyway.