Can't recognize win8 metro element when replay scripts

Bug reports.
troy
Posts: 9
Joined: Wed Apr 29, 2009 3:39 am

Can't recognize win8 metro element when replay scripts

Post by troy » Fri May 11, 2012 2:50 am

Hi,
We are working with Ranorex 3.2.3.16825 on Windows 8 Consumer Preview 64bit version,and current user is a member of Administrators group.

We met a very thorny issue about Windows8 Metro UI and Charms bar.

We can recognize some objects by Ranorex Spy in Metro/Charms bar,also can record the scripts by Ranorex Recorder, but the recorded scripts cannot replay successfully. Always met the "No element found for path" even it's just be recorded by the tool :(

For example,I did very simple record - press windows key to go to Metro start screen,then cick desktop icon on the metro screen to go back to desktop. Also tried to use spy to replace the xpath with spied result, still doesn't work.

Ranorex can not recognize the element of Desktop item in Metro,the error message as blow:
Failed to find item 'sampleRepository.ContainerStart_menu.ListItemDesktop'. The folder 'sampleRepository.ContainerStart_menu' was not found. No element found for path '/container[@automationid='Start menu window']' within 30s.
Show/Hide Stacktrace
at Ranorex.Core.Repository.RepoItemInfo.Find[T](Boolean findSingle, Boolean throwException) at Ranorex.Core.Repository.RepoItemInfo.CreateAdapter[T](Boolean throwException) at sample.sampleRepositoryFolders.ContainerStart_menuAppFolder.get_ListItemDesktop() in c:\Users\admin\Documents\Ranorex\RanorexStudio Projects\sample\sample\sampleRepository.cs:line 119 at sample.Recording1.Ranorex.Core.Testing.ITestModule.Run() in c:\Users\admin\Documents\Ranorex\RanorexStudio Projects\sample\sample\Recording1.cs:line 85 at Ranorex.Core.Testing.TestSuiteModule.RunInternal(DataContext parentDataContext)
metroError.png
metroError.png (274.39 KiB) Viewed 2105 times
Would you give some suggestion or solution on this problem? Many thanks in advance.
Think Different!

troy
Posts: 9
Joined: Wed Apr 29, 2009 3:39 am

Re: Can't recognize win8 metro element when replay scripts

Post by troy » Mon May 14, 2012 6:55 am

I would like to add a little explanation, although UAC(User Account Control) is turn off,the recorded scripts cannot replay successfully also :(
Untitled.png
Untitled.png (25.86 KiB) Viewed 2071 times
Think Different!

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

Re: Can't recognize win8 metro element when replay scripts

Post by Support Team » Mon May 14, 2012 2:49 pm

Currently, you have to explicitly start the Ranorex Tool as Administrator; i.e. right click on Ranorex Recorder (or Spy, Studio) and select "Run as administrator". Then the replay should work.

The problem is that automating the Window 8 Metro UI requires special privileges. The Ranorex Tools (Spy, Recorder, Studio) already acquire this privilege; that's why Tracking and Recording works, but the replay is done by a separate process and that process only inherits the privilege if the parent process (Ranorex Tool) is explicitly started as Administrator.

We will try to facilitate automating the Metro UI for the Windows 8 RTM.

Regards,
Alex
Ranorex Team
.
Image

troy
Posts: 9
Joined: Wed Apr 29, 2009 3:39 am

Re: Can't recognize win8 metro element when replay scripts

Post by troy » Wed May 16, 2012 5:02 am

Support Team wrote:Currently, you have to explicitly start the Ranorex Tool as Administrator; i.e. right click on Ranorex Recorder (or Spy, Studio) and select "Run as administrator". Then the replay should work.

The problem is that automating the Window 8 Metro UI requires special privileges. The Ranorex Tools (Spy, Recorder, Studio) already acquire this privilege; that's why Tracking and Recording works, but the replay is done by a separate process and that process only inherits the privilege if the parent process (Ranorex Tool) is explicitly started as Administrator.

We will try to facilitate automating the Metro UI for the Windows 8 RTM.

Regards,
Alex
Ranorex Team
Alex,thanks very much for your kindly reply.
Yes,once right click on Ranorex Recorder,and select "Run as administrator",the replay works. :)

However,when we use the same way to execute the build file(i.e. ..\bin\Debug\sample.exe),right click on sample.exe,and select "Run as administrator",it doesn't work, still met the "No element found for path" error when replay metro element :(
Could your tell me how to fix that? Because we need to invoke the ranorex compiled executive file directly,not by Ranorex Recorder or Ranorex Studio.

Moreover,right click on executive file and select "Run as administrator" is a manual action,
is there any method or command to invoke application as administrator directly?
Think Different!

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

Re: Can't recognize win8 metro element when replay scripts

Post by Support Team » Fri May 18, 2012 3:25 pm

Hi,

That's because the exe is not in a trusted location and not signed.
As current workaround you can also use the TestSuiteRunner, but take in account that you also have to open it as administrator, it is located in the bin directory of Ranorex.
As Alex wrote we will try to improve support for Metro in one of the future releases.

Regards,
Markus
Ranorex Support Team
.
Image

[email protected]
Posts: 1
Joined: Tue Dec 11, 2012 9:22 am

Re: Can't recognize win8 metro element when replay scripts

Post by [email protected] » Tue Dec 11, 2012 9:31 am

Hi,

Can TestSuiter Runner be invoke through command?
Otherwise it cannot resolve our issue.
We need invoke testsuite.exe through command.

When will testsuite.exe be invoked successfully for win8 metro testing?
Is there any plan to reslove it? and when? :-)

Thanks very much.

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

Re: Can't recognize win8 metro element when replay scripts

Post by Support Team » Tue Dec 11, 2012 4:52 pm

Hi,

You can use the UiaLauncher in order to start your test executable via command line.
UiaLauncher (<Ranorex Installation Folder>\bin\Ranorex.UiaLauncher32.exe), you have to pass the executable name as the first argument.

For more details please take a look at the following forum posts: How to run testsuite against win8 metro app by command line, Windows 8 Metro app via Ranorex C#.

Regards,
Markus
.
Image