Here is another question, if you don't mind.
There is a Windows application with a toolbar across that has File Search Help.
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#)
Consider the Point And Fix mode of Object Spy (https://support.smartbear.com/testcomplete/docs/testing-with/exploring-apps/object-spy/about.html).
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.
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.
I actually did record, and it works in the recording. But I don't know how to convert the mapped objects into my C# universe that has no mapped objects, as it uses the mapped names. But I now see the point and click. You do ctrl-shift-a to select the item. So that seems to have done it for me.
I don't know how Connect works... however, based upon some of your previous examples, it seems like you COULD do something like
It just gives a larger red frame, and I can't select anything inside, either with the spy or point and click.
This makes me think that you tested application wasn't prepared properly and TestComplete cannot see objects inside the application. Could you please make sure that you added all the required libraries?
It says you need do this:
p = TestedApps["Items"](0)["Run"]();
only if we aren't using Connect.RunTest(). But we are using Connect.RunTest() so I do not need to do that, correct?
Also, for libraries we have these attached (please see attached image). I masked our company confidential libraries to protect confidentiality. Am I missing something? It looks like they are all there.
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.