Java Swing jPopupMenu / contextmenu

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
mattmccall
Posts: 29
Joined: Mon Nov 12, 2012 8:13 pm

Java Swing jPopupMenu / contextmenu

Post by mattmccall » Thu Apr 25, 2013 9:15 pm

I am having trouble identify an object in a java swing application.

I am trying to track a menu item and its not finding it with the spy. All it is seeing is the selected frame and it cannot be found.

If I highlight the menu item a want to track and then do Ctrl+Win keys I can identify it. When I do this it gives me a path of:

/form[@title='<application name>']/contextmenu/menuitem[@text='<menu item text>']

It see's this item as a context menu of the application and not the selected frame. If I add this to the repository and try to click it for example the object is not found.

When I look at the details of this context menu it says its a jPopupMenu. I cannot find a way to access this menu and the items within the menu.

Does anyone have any suggestions?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Java Swing jPopupMenu / contextmenu

Post by Support Team » Fri Apr 26, 2013 3:29 pm

Hello,

Thank you for your posting.

Unfortunately, I couldn't reproduce your issue.
In my test case, the recorded actions was executed successfully.

The path to your item looks correct.
Could you please send us a Ranorex Snapshot in order to analyze your issue?
Please take a look at Creating Ranorex Snapshot Files in our User Guide.

Thank you in advance.

Regards,
Markus (T)
.
Image

mattmccall
Posts: 29
Joined: Mon Nov 12, 2012 8:13 pm

Re: Java Swing jPopupMenu / contextmenu

Post by mattmccall » Fri Apr 26, 2013 4:31 pm

I attached a file using Ctlr+Win to spy the object:
ctrlWin_Snapshot.rxsnp
(106.26 KiB) Downloaded 183 times
When I add /form[@title='C4C-THH']/contextmenu/menuitem[@text='Providers'] to my repository and try to ".click()" on the item I get an error saying there is no such thing.

Also, like i said before, if i try to track that item from the spy (not using Ctlr+Win) it only selects the selected frame.

I also attached a screen shot, this shows the menu I am trying to access, the menu is on the selected frame:
/form[@title='C4C-THH']/container[@name='desktop']/element[@accessiblename='UM Screen']

Screen shot:
Menu Item.png
Menu Item.png (89.57 KiB) Viewed 1748 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Java Swing jPopupMenu / contextmenu

Post by Support Team » Mon Apr 29, 2013 3:31 pm

Hello,

Thank you for the snapshot file, but unfortunately this file is invalid.
Could you please post another snapshot file?
Please take a look at the section "Creating Ranorex Snapshot Files" in order to get more information how to create snapshot files.
Thank you!

Regards,
Bernhard
.
Image

mattmccall
Posts: 29
Joined: Mon Nov 12, 2012 8:13 pm

Re: Java Swing jPopupMenu / contextmenu

Post by mattmccall » Mon Apr 29, 2013 6:56 pm

I opened the snapshot locally here, and I see what is shown in the attached screen shot. I am betting this is what you are seeing as well. This is what happens after a while to the object. The object becomes invalid. This is why I cannot find the object when I need it. I have no idea what is going on here.

I am working remotely today and for some reason the ctrl+Win is not working when I remote into my automation machine so tomorrow when I am in the office I will get another snapshot however I believe it will be the same thing as the one I attached earlier. I will also take a screen shot of it so that you can see what it looks like before it becomes invalid.
Attachments
snpsht_Invalid.JPG
snpsht_Invalid.JPG (83.58 KiB) Viewed 1731 times

mattmccall
Posts: 29
Joined: Mon Nov 12, 2012 8:13 pm

Re: Java Swing jPopupMenu / contextmenu

Post by mattmccall » Mon Apr 29, 2013 7:49 pm

Ok, I got another snapshot, but it is too big to attach. I attached a screen shot of what I see when I do this. Hopefully this one works.
Attachments
snapshot4.rxsnp
(99.48 KiB) Downloaded 172 times
snapshot2_ScreenShot.JPG
snapshot2_ScreenShot.JPG (92.5 KiB) Viewed 1729 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Java Swing jPopupMenu / contextmenu

Post by Support Team » Tue Apr 30, 2013 2:26 pm

Hello,

Thank you for the snapshot file, but unfortunately this file is also invalid.
I will send you an email with the access information to our ftp server. Please upload the snapshot file there.
You said that the object becomes invalid during the test.
Are there any error messages, or exceptions shown in the report file?
Could it be that the application crashed during the test run?
Are there any error messages in the Windows Event Viewer?
Thank you!

Regards,
Bernhard
.
Image