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.Buttons['1'].Click();
$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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: