Page 1 of 1

Ranorex on Oracle VirtualBox

Posted: Mon Aug 08, 2016 2:01 pm
by Kinheart
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

Re: Ranorex on Oracle VirtualBox

Posted: Mon Aug 08, 2016 2:17 pm
by Martin
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.

Re: Ranorex on Oracle VirtualBox

Posted: Mon Aug 08, 2016 2:56 pm
by Kinheart
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"

Re: Ranorex on Oracle VirtualBox

Posted: Mon Aug 08, 2016 3:19 pm
by krstcs
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.

Re: Ranorex on Oracle VirtualBox

Posted: Mon Aug 08, 2016 3:39 pm
by Kinheart
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.

Re: Ranorex on Oracle VirtualBox

Posted: Mon Aug 08, 2016 4:50 pm
by krstcs
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.

Re: Ranorex on Oracle VirtualBox

Posted: Tue Aug 09, 2016 9:06 am
by Kinheart
"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.

Re: Ranorex on Oracle VirtualBox

Posted: Tue Aug 09, 2016 9:44 am
by Martin
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.

Re: Ranorex on Oracle VirtualBox

Posted: Tue Aug 09, 2016 12:48 pm
by Kinheart
No, I tracked the element with Spy on my VM, it did not help. That is the problem. Still fighting with it.

Re: Ranorex on Oracle VirtualBox

Posted: Tue Aug 09, 2016 1:14 pm
by odklizec
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).

Re: Ranorex on Oracle VirtualBox

Posted: Wed Aug 10, 2016 7:46 am
by Martin
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