How to open a Windows VM with password under VirtualBox?

Ask general questions here.
Mague
Posts: 6
Joined: Wed Aug 26, 2015 1:23 am

How to open a Windows VM with password under VirtualBox?

Post by Mague » Fri Sep 11, 2015 2:51 am

Hi everyone,

I try to record and replay a simple test that
1- Open VirtualBox
2- Select a VM (Windows 7 localized in FR)
3- Enter the password for Windows
4- Shut down windows VM
5- Close VirtualBox

The scenario recording (using instant recording or Desktop record) is fine.
(You can take a look on it in the attached document)
But every time, when I replay it, nothing append at the step 3 - enter Windows password
End, the test passed (green report at the end)

Someone has an idea on why the windows password entry doesn't work?

Thanks

Mague
Attachments
Test-VM-Scenario.png
Open a VirtualBox Windows VM scenario
Test-VM-Scenario.png (208.38 KiB) Viewed 622 times

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

Re: How to open a Windows VM with password under VirtualBox?

Post by odklizec » Fri Sep 11, 2015 7:53 am

Hi,

Could you please post a sample solution, instead of just screenshot? It would be much easier to check what's wrong and eventually, suggest a solution.

My guess is, that the reason why test passed but the text is not entered is, that the KeySequence is performed, but not in text input! I would suggest to replace the KeySequence with SetValue action. In some cases, it may be necessary to use KeySequence, but in general, SetValue is much more reliable solution of setting texts to input elements.

On another look, I think using SetValue may not help either. If I'm not mistaken, Ranorex is not able to identify the individual login input boxes and instead detects single Login dialog element, with no access to its input fields, right? It's because VirtualBox is a QT-based app and Ranorex has apparently no access to underlying elements. So you are probably out of luck with using Ranorex for VirtualBox-based scenarios. But of course, you can still use Ranorex if installed in VirtualBox VM.

BTW, looking at the screenshot, I would definitely suggest to get rid of all Delays in your script and replace them (if needed) with WaitFor Exists actions. It's much better solution than hardcoded delays.
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

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

Re: How to open a Windows VM with password under VirtualBox?

Post by Support Team » Fri Sep 11, 2015 10:38 am

IMHO the problem is that the recorded values are just wrong, i.e. there were only key-up events recorded. The reason I guess is that the VM "swallows" all keyboard inputs and does not let them through to the host machine.

However, as odklizec said, you should be able to just correct the value of the KeySequence action using the correct user name and password.

BTW, I would not use SetValue in that case but stick with the KeySequence action, because the VM window will most likely be seen as one large element with no support for setting the user/password using SetValue.

Regards,
Alex
Ranorex Team
.
Image