Ranorex on Oracle VirtualBox

Ask general questions here.
Kinheart
Posts: 10
Joined: Tue Oct 06, 2015 7:10 pm

Ranorex on Oracle VirtualBox

Post by Kinheart » Mon Aug 08, 2016 2:01 pm

Good day!

I have a problem, when I run Autotests using Ranorex on my Virtual Machine(Oracle VM) most of the time, Ranorex can't find elements(using Rpath). But when I start those Autotests on my Local machine, everything works perfectly. Can someone help? Is this the problem that Ranorex has with Oracle VM?

I am using Ranorex-5.4.2 libs + Visual Studio 2013 (VM is Windows 7).

Best Regards

Martin
Posts: 152
Joined: Fri Aug 15, 2014 12:24 pm

Re: Ranorex on Oracle VirtualBox

Post by Martin » Mon Aug 08, 2016 2:17 pm

First of all i would go over the xpaths for problematic elements both in Oracle VM and your local machine to see if there are any differences.

Kinheart
Posts: 10
Joined: Tue Oct 06, 2015 7:10 pm

Re: Ranorex on Oracle VirtualBox

Post by Kinheart » Mon Aug 08, 2016 2:56 pm

Rpath is really simple, but it still doesn't work. We tried on several VMs and it doesn't work on 90%. But on Local machines, everything is fine. I even have Rpath with only two elements, but it still doesn't work. When we went to Debug it, we saw that Ranorex locates an empty folder with no elements inside, but the currently opened folder has some files in it(it is the only opened folder in Windows).

Simple Rpath - "/form[@processname='explorer']/element[@class='ShellTabWindowClass'] +
//container[@automationid='listview']//list//listitem"
Last edited by Kinheart on Mon Aug 08, 2016 3:37 pm, edited 1 time in total.

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

Re: Ranorex on Oracle VirtualBox

Post by krstcs » Mon Aug 08, 2016 3:19 pm

Ranorex ALWAYS returns the FIRST MATCHING ELEMENT when you give it an XPath. My guess is that the 'empty folder' is the first element that matches your XPath.
Shortcuts usually aren't...

Kinheart
Posts: 10
Joined: Tue Oct 06, 2015 7:10 pm

Re: Ranorex on Oracle VirtualBox

Post by Kinheart » Mon Aug 08, 2016 3:39 pm

Yes, I know, RanorexSpy with this Rpath returns many elements, on local machine this Rpath returns many elements. But on VM, it returns 0 elements. That is the problem.

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

Re: Ranorex on Oracle VirtualBox

Post by krstcs » Mon Aug 08, 2016 4:50 pm

You said in your post that it was returning an empty folder, so I took that to mean that it found an element but it wasn't the correct one. Maybe I'm misunderstanding, but it seems you are now saying that the element isn't found at all by Spy on the VM. Is that correct? Have you tried manually tracking the element on the VM in Spy to make sure that Ranorex has instrumented the application correctly on the VM?

Assuming the AUT is instrumented correctly, please post the RanoreXPath of the element on your local system and the same element on the VM. Note: do not use your existing RanoreXPath to find the element, instead manually track it with Ranorex Spy in both places and post the RanoreXPaths that Spy returns. You most likely will see something different in them, which is where the problem would be.

You might also post a Ranorex Snapshot of the element on your system and on the VM. Without this it will be very difficult, if not impossible, to give you any meaningful help.
Shortcuts usually aren't...

Kinheart
Posts: 10
Joined: Tue Oct 06, 2015 7:10 pm

Re: Ranorex on Oracle VirtualBox

Post by Kinheart » Tue Aug 09, 2016 9:06 am

"Maybe I'm misunderstanding, but it seems you are now saying that the element isn't found at all by Spy on the VM. Is that correct?" -

I have one opened folder with 4 files in it. I have one simple Rpath to it(in my second post). Whit this path, Ranorex on My Local machine finds 4 elements, but on my VM it finds 0 elements. When I tried to narrow down the search(remove elements from Path) to -"//form[@processname='explorer']/element[@class='ShellTabWindowClass']"

In VM Ranorex finds a folder, but when I debug it and see what's inside, there is nothing, it's like an empty folder. And this is only one example, the same thing happens in different cases.

"instead manually track it with Ranorex Spy in both places and post the RanoreXPaths that Spy returns." - tried it many times, on local machine everything is great, but on VM nothing.

"You might also post a Ranorex Snapshot of the element on your system and on the VM." - Ok, I will do this.

Martin
Posts: 152
Joined: Fri Aug 15, 2014 12:24 pm

Re: Ranorex on Oracle VirtualBox

Post by Martin » Tue Aug 09, 2016 9:44 am

I still undestand from your posts that you haven't actually tracked the paths with Spy tool on the VM's but instead you have ran the solutions on VM.

For my testing setup I had a similar issue because locally form was defined with 1 value and on VMs it was defined with another. So for me a working xpath for both local and VM would be "/form[@connectiondescription='something' or @connectiondescription='something else']" That can easily be assigned to the repository's base object.
Last edited by Martin on Wed Aug 10, 2016 7:34 am, edited 1 time in total.

Kinheart
Posts: 10
Joined: Tue Oct 06, 2015 7:10 pm

Re: Ranorex on Oracle VirtualBox

Post by Kinheart » Tue Aug 09, 2016 12:48 pm

No, I tracked the element with Spy on my VM, it did not help. That is the problem. Still fighting with it.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3946
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Ranorex on Oracle VirtualBox

Post by odklizec » Tue Aug 09, 2016 1:14 pm

Hi,

So can you please confirm that the xpath is EXACTLY the same if tracked on desktop as well as VM? If so, then your problem is most probably a timing issue, where an action is performed before the element in question is fully loaded?

As requested before, please post a Ranorex snapshot (not screenshot!) from both desktop and VM. Then please post also a screenshot of your recording (ideally post entire recording file).
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Martin
Posts: 152
Joined: Fri Aug 15, 2014 12:24 pm

Re: Ranorex on Oracle VirtualBox

Post by Martin » Wed Aug 10, 2016 7:46 am

Also you could actually describe the VM setup a little further. Another possiblity is related to it's setup. I'm not sure how much of this is consistent with Oracle VMs but there are some requirements to run test successfully on VMs. 1st of all, if no configuration is done, VM has to have a visual desktop, it must not be minimized and the screen saver must not be activated. This will also result in Ranorex not being able to find the required elements.

Further more there is a need for some regedit parameter changes and a bat script that will handle the correct closing of the VM.

Some informative reading regarding this:
http://www.ranorex.com/forum/running-au ... t1295.html
http://blog.smartbear.com/software-qual ... p-windows/
http://www.ranorex.com/forum/how-to-run ... t5879.html