Tag Archives: Metro

Metro automation: getting started


Visit our Metro UI automation page.

 

After a long hiatus, yesterday, I suddenly thought that it’s the time to return to Metro automation. To my surprise, rumors have been already circulating that Windows 8 Next Preview is upcoming in hours. Intuition? Maybe. In time is in time.

Yesterday I added to UIAutomaitonSpy the functionality to run PowerShell scripts. Today I polished a bit (here is great volume of work to do).

Let’s start. I tested the following on Windows 8 CP x64 and Windows 8 RP x86 (Release Preview of June, 01st). The binaries was built on a Windows 8 CP x64 box.ImageC

1. download the package. It’s not the default release now.

2. Unpack the package to a certain directory. We need to put in a secure location. One of them is %SystemRoot%, the other is %ProgramFiles%. The latter is more appropriate. In my tests, I creates the “C:\Program Files\1” directory and put the binaries there. You have in the folder UIAutomationSpy.exe, the config, UIAutomation.dll and TMX.dll.

3. One more file you’ve got is a certificate. You need to install it. Alternatively, you can sign UIAutomationSpy.exe with the certificate you possibly have.

If you have no your own certificate, below are screenshots showing how to use the certificate from the package. Run certmgr, for example, from cmd.exe, or from the Start Screen

and follow the pictures:

Image

Image

Image

Image

Image

Image

Image

After you installed the certificate and the application in the secure location (you might set the policy not to require this if you’d like to), you can run the application. If you want to change the policy, run gpedit.msc, for example, from the Start screen

and set the following setting:

After you’ve finished, reload policies:

For the first test, just run the application, agree with UAC and manually run the Start screen by pressing the Win button. Now you should see something like on the picture below:

Image

On the picture, UIAutomationSpy shows the code for the Mail tile. It is bordered with the red rectangle. All that I’d like to offer is to explore tiles:

Image

This is a text box, Edit in terms of UIAutomation.

Tomorrow I’m planning to start discussing how to write and run scripts for Metro UI.

Beware: navigation among Metro items


To whom it might frighten: multi-string names. There are no AutomationId here, only complicated names to get a control.

The Start Screen is much better:

What’s inside? The Mail application:

Kobo:

As can be seen from the last two figures, UI Automation is available to some extent. Nevertheless, we are far away from the ultimate happiness: there’s almost nothing to do in Solitaire.

Dictionary.com is also automation-ready:

It’s time to please ourselves with one more fascinating pic from the Store and say to Microsoft: “Think more about automation engineers _before_ the release”:

Happy testing!

%d bloggers like this: