Menus have different process names on different machines

Ranorex Spy, Recorder, and Studio.
MatthiasT
Posts: 3
Joined: Mon Apr 14, 2014 3:17 pm

Menus have different process names on different machines

Post by MatthiasT » Tue Apr 22, 2014 10:25 am

Hi there,

we have a small problem regarding process names of menus and context menus. I think I solved it, but I would still like to know why it occured in the first place.

When we are accessing menus and context menus in our application, a generic Java process is started. So all the elements from this process will be in a different section of the Ranorex repository than the rest. What is interesting about this, is that the name of the process seems to depend on the machine running the Ranorex Studio. On my laptop, the process is called "javaw", on a virtual machine it is called "designer". Therefore a test recorded on my laptop won't run on the virtual machine. I solved this by simply deleting the process name. This is only the second best solution, however, since you always have to remember to do this.

Do you have any idea, why the process names are different? What's the best way of dealing with this? I would like to provide a snaphot, but since it is a context menu, I can't take them. Whenever I open up the spy again, the context menu is gone. :(

Thanks very much.

Matthias
Attachments
Prozessname2.png
Prozessname2.png (14.89 KiB) Viewed 1131 times
Prozessname.png
Prozessname.png (9.95 KiB) Viewed 1131 times

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Menus have different process names on different machines

Post by krstcs » Tue Apr 22, 2014 1:42 pm

What version of Ranorex are you using?

What versions of Java are running on each system? (I would guess the issue is related to this.)

Can you provide a snapshot of the application under test so we can see the actual structure? http://www.ranorex.com/support/user-gui ... files.html



I would suggest that you use Ranorex Spy on each system to try to see if there is another attribute you can use to identify the menus.

Also, you might try to have the developers add an ID attribute that would be unique. You could then use that ID instead of the processname attribute.
Shortcuts usually aren't...

mzperix
Posts: 137
Joined: Fri Apr 06, 2012 12:19 pm

Re: Menus have different process names on different machines

Post by mzperix » Tue Apr 22, 2014 11:12 pm

Hi MatthiasT,

this sounbds more like a java problem to me. I found this forum: http://stackoverflow.com/questions/1152 ... ocess-name

Looks like on the virtual machine your java application has a unique process name, while in your laptop not. not sure about that, maybe a java reinstall in the virtual machine could solve the problem?

Another workaround would be to edit the path weights, so on path generation ranorex would leave out the processname, on those occasions.

A third one is that to make ranorex path the following:

Code: Select all

/contextmenu[@processname='javaw' or @processname='designer']
this code will handle both machines and no need to remember edit the path.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Menus have different process names on different machines

Post by krstcs » Wed Apr 23, 2014 1:54 pm

Without having more information, I would agree with Zoltan that it is probably related to Java.

Zoltan, I can do you one better on the path :D ---

Code: Select all

/contextmenu[@processname~'^(javaw|designer)$']
This says "Find me a contextmenu item that has a processname attribute that matches the REGEX of 'start of string, followed by either "javaw" or (|) "designer", followed by end of string'".

This allows you to edit it inside the XPath editor in Ranorex. The literal "or" in the XPath will cause Ranorex to not be able to use the RanoreXPath editor because OR logic is harder to realize in the dialog than AND logic.

:D
Shortcuts usually aren't...

mzperix
Posts: 137
Joined: Fri Apr 06, 2012 12:19 pm

Re: Menus have different process names on different machines

Post by mzperix » Thu Apr 24, 2014 8:00 am

Wow, thanks krstcs :) Never late to learn more :D