Monthly Archives: January, 2014

0.8.7 Beta 1

The first stable beta with the new elements’ object model is out! Now we have not only cmdlets, but also ‘short cuts’ via dotted notation:

$wnd = Start-Process calc -PassThru | Get-UiaWindow;
$wnd.Descendants.MenuItems['view'].Expand() | Get-UiaMenuItem Standard | Invoke-UiaControlClick;
$wnd.Descendants.MenuItems['view'].Expand() | Get-UiaMenuItem Worksheets | Move-UiaCursor -X 10 -Y 10 | Get-UiaMenuItem Mortgage | Invoke-UiaMenuItemClick;
sleep -Seconds 2;
$wnd.Descendants.Edits['purch*price'][0].Value = 123;
$wnd.Descendants.MenuItems['view'].Expand() | Get-UiaMenuItem basic | Invoke-UiaMenuItemClick;

Sometimes one approach is better, sometimes another.

# may require running powershell as administrator
$grid = Get-UiaWindow -n services | Get-UiaDataGrid;
$grid.Descendants.DataItems['application*experience'][0].InvokeContextMenu() | Get-UiaMenuItem start | Invoke-UiaMenuItemClick;

Currently, the dotted object model does not support timeouts. It will be available in beta 2.

%d bloggers like this: