Page 1 of 2

How to Test Windows 8.1 app?

Posted: Fri May 30, 2014 4:36 pm
by houseofcutler
Hi All,

I thought this would 'just work' but it doesn't. I am trying to test an windows 8.1 app made by my company. It is installed on my own machine and works fine.

I opened up a new solution in Ranorex Studio - set it to 'General Recording' and started recording actions.

When I looked at what had been recorded I discovered that most things were missing.

An item had been created for the application - ComGroupcallEmerge
All the mouse clicks were linked to an item 'List1' and that was about it.

Having looked around for information on the correct way to record 8.1 apps I cant really find anything. I thought maybe this is like with mobile apps where you have to actually add the open application action to the test. but I don't know how I am supposed to identify the app I want to open I tried ComGroupcallEmerge and this didn't work.

Does Ranorex even support 8.1 apps? If so can someone please point me in the right direction to get started.

Many thanks

Ben

Re: How to Test Windows 8.1 app?

Posted: Fri May 30, 2014 5:25 pm
by krstcs
Removed due to incorrect information! :D

Re: How to Test Windows 8.1 app?

Posted: Fri May 30, 2014 7:33 pm
by Support Team
Ranorex DOES support automation of Windows 8/8.1 Modern UI Apps (aka Metro apps) since version 4.0 (see the Release Notes).

Testing Windows 8 Modern UI Apps might be a bit trickier, though, than testing normal Windows applications, because of the elevated security context those apps run in. Make sure to have a look at the corresponding troubleshooting guidelines if you experience bad or no object recognition:
http://www.ranorex.com/support/user-gui ... html#c4709

Additionally, Ranorex uses the UI Automation interface to recognize UI elements in Windows 8 Modern UI Apps, so we are a bit dependent on that interface being correctly implemented by the used controls. This is not a problem for standard controls, but could be if you have a custom drawn controls, not built-up by standard controls.

Can you maybe post a snapshot of your application?

Regards,
Alex
Ranorex Team

Re: How to Test Windows 8.1 app?

Posted: Fri May 30, 2014 8:03 pm
by krstcs
Ah, yeah, sorry, my mistake, I was thinking Windows Phone apps.

My apologies!

Re: How to Test Windows 8.1 app?

Posted: Fri May 30, 2014 8:52 pm
by Support Team
krstcs wrote:Ah, yeah, sorry, my mistake, I was thinking Windows Phone apps.
My apologies!
No apologies needed, we are glad that you answer that many questions. Considering the quantity of your answers, there almost needs to be something wrong at some point :wink:

Anyway, you right about Windows Phone apps.

Regards,
Alex
Ranorex Team

Re: How to Test Windows 8.1 app?

Posted: Fri May 30, 2014 9:58 pm
by krstcs
HAHA!! That is true Alex!

Re: How to Test Windows 8.1 app?

Posted: Mon Jun 02, 2014 11:05 am
by houseofcutler
Hi Alex,

Thank you for your response.

I have tried the troubleshooting steps.
Reason #1:
Test execution is started using a Ranorex tool and the setting 'Use UiaLauncher to elevate privileges for processes started by tools' ('General Settings' dialog -> 'Advanced' tab) is disabled.
This setting is enabled
Reason #2:
Ranorex is not installed in a secure location.
Ranorex is installed in Program files (x86)
Reason #3:
The test executable is not started by a Ranorex Tool.

Solution #1:

Start the test suite using the TestSuiteRunner.
I am unable to get Ranorex to open the windows app so cant map anything correctly and therefore dot have any viable tests to playback.
Solution #2:

Use the Ranorex UiaLauncher (<Ranorex Installation Folder>\bin\Ranorex.UiaLauncher32.exe) to start the test executable by passing the executable name as the first argument.

E.g. Ranorex.UiaLauncher32.exe <Solution Folder>\bin\debug\<Project Executable>.exe.
When I ran this from a command prompt as instructed - although there were no errors nothing happened.
Solution #3:

Add the following lines of code to the Program.cs/Program.vb of the main (executable) project:
if (Ranorex.Core.Util.IsRestartRequiredForWinAppAccess)
return Ranorex.Core.Util.RestartWithUiAccess();
I found this code already present but commented out in the program.cs file. I uncommented the two lines and saved the file.

When executing the test suite I get an Unhandled exception error

"Ranorex.RanorexException: The executable needs to be restarted with UI access rights. In order to debug the process, please run your IDE as administrator.
at Ranorex.Core.Util.RestartWithUiAccess
at Emerge_Windows.Program.Main in c:\Users\bcutl_000\Documents\Ranorex\RanorexStudio Projects\Emerge- Windows\Emerge-Windows\Program.cs:line 32"

Ranorex Studio is already running as Administrator, Also I am logged onto my machine as an administrator. Not sure what else I need to do?

--- Problems opening the application ---
I have tried using the path to the executable itself - located within the WindowsApps directory.
This causes a 'Windows protected your PC' message claiming the application is from an unknown publisher (which isn't the case) I can select 'Run Anyway' but Ranorex still fails stating - "The specified executable is not a valid application for this OS platform"

I then found that if I try to launch the exe myself form windows explorer (not with Ranorex) I still get an error saying that "This application can only be run in the context of an application container". So I guess this is not the way to go with Ranorex either.

--- XML Spy ---
Running XML Spy (stand alone) as administrator it does not list the application in question at all - even though it is running - I am not able to 'track' any of the elements as XML spy registers this as if I had clicked on whatever is behind the app, e.g. the desktop.

For this reason I cannot provide you with a snapshot of the application.


As you can see I am not really getting anywhere with this - sorry for writing such a massive post but I thought it best to provide all of the information I could. If you need a copy of the app (Ranorex Support guys only) then I could provide this for you also.

Please let me know if you require anything else or if you have any other suggestions as to what I can try next.

Thanks

Ben

Re: How to Test Windows 8.1 app?

Posted: Mon Jun 09, 2014 8:59 pm
by Support Team
Hi Ben,

Sorry for the late reply! I hope that my help is not too late...

Just a quick question beforehand: Which version of Ranorex do you have installed?
houseofcutler wrote:Ranorex Studio is already running as Administrator, Also I am logged onto my machine as an administrator.
Did you specifically right click the Ranorex Studio start menu icon and select "Run as Administrator"? Ranorex Studio should then have the word "Administrator" in its title bar.
houseofcutler wrote:Running XML Spy (stand alone) as administrator it does not list the application in question at all - even though it is running - I am not able to 'track' any of the elements as XML spy registers this as if I had clicked on whatever is behind the app, e.g. the desktop.
With "XML Spy" you mean Ranorex Spy?

If Ranorex Spy can't see your Windows 8 (Modern UI) app, then something weird is going on. There should not be anything special you have to do in order to see Windows 8 apps in Ranorex Spy. The easiest way to track Windows 8 apps (if you don't have multiple monitors) is to tick the "Always On Top" checkbox and then use the Instant Track keyboard shortcut Ctrl+Win while hovering over the Windows 8 app with the cursor.

Did you already try to completely uninstall and then re-install Ranorex from scratch? Maybe somethings broken with the installation.

BTW is this a public Windows 8 app so we can maybe download it ourselves and see if its working on our machines?

Regards,
Alex
Ranorex Team

Re: How to Test Windows 8.1 app?

Posted: Tue Jun 10, 2014 4:03 pm
by houseofcutler
Hi Alex,

Thank you for your reposnse, no problem about the 'late reply' I have plenty of other Ranorexing that has kept me busy.
Which version of Ranorex do you have installed?
5.0.3
Did you specifically right click the Ranorex Studio start menu icon and select "Run as Administrator"? Ranorex Studio should then have the word "Administrator" in its title bar.
I have actually set the application to open as administrator by default - and yes it does say (Administrator) in the title bar
With "XML Spy" you mean Ranorex Spy?
Sorry yes I do mean Ranorex Spy
Did you already try to completely uninstall and then re-install Ranorex from scratch?
Haven't yet I can give this ago but not right now...
is this a public Windows 8 app so we can maybe download it ourselves and see if its working on our machines?
It is not public but I will PM you a link to the downloads

Thank you for your help

Ben

Re: How to Test Windows 8.1 app?

Posted: Thu Jun 12, 2014 4:16 pm
by Support Team
houseofcutler wrote:I have actually set the application to open as administrator by default - and yes it does say (Administrator) in the title bar
I guess this is the problem. If you set this option directly on the RanorexStudio.exe, this (weirdly) limits access to Windows 8 UI apps. If you uncheck this option, Ranorex Studio should be able to correctly identify your app.

If you still want Ranorex Studio to always be started as administrator, you can change the shortcut file properties instead:
Shortcut_Advanced_Properties.PNG
FYI: We now also added this possible problem to the troubleshooting guidelines in the user guide.

Regards,
Alex
Ranorex Team

Re: How to Test Windows 8.1 app?

Posted: Tue Jun 17, 2014 8:53 am
by houseofcutler
I made the changes you suggest and this has indeed worked - just tried a recording and Ranorex appears to be detecting everything as it should now.

Thank you very much. :D

Re: How to Test Windows 8.1 app?

Posted: Wed Oct 22, 2014 4:10 am
by nitikagupta2008
Hi Ben & Alex

Can someone please guide me how to start automation of windows 8.1 store apps i.e. appx apps only compatible in windows 8.1

What is the pre-requiste for the same in terms of OS and all.

This is really urgent . Please advice .

Regards
Nitika

Re: How to Test Windows 8.1 app?

Posted: Fri Oct 24, 2014 10:06 am
by Support Team
Hello Nitika,

As already discussed via email:

If you are running Windows 8.1 on a desktop you should be able to automate 8.1 native applications without issues. Unfortunately, Ranorex cannot be used to test .appx apps on mobile devices at the moment but we are currently working on a solution.

Our system requirements can be found here:
http://www.ranorex.com/support/user-gui ... ments.html

Regards,
Robert

Re: How to Test Windows 8.1 app?

Posted: Mon Nov 10, 2014 4:55 pm
by nitikagupta2008
Hi All,

How to start automating windows 8.1 app if it is installed from the store.

For me i started
1)Global Recording

But the app isnt launching on replay

Re: How to Test Windows 8.1 app?

Posted: Wed Nov 12, 2014 9:53 am
by Support Team
Hello nitikagupta2008,

The metro app isn't started, because it seems like you didn't record the necessary steps to start the app. Either start the executable of the app or if there isn’t any, record the steps you would manually do to start the app.

E.g.:
  • • Press “Win + Q” (Opens Search)
    • Enter the name of the application
    • Press enter
Regards,
Robert