Access contents of a pane

Mar 4, 2015 at 1:31 AM
Hi, I am stumped on how/if you can access the contents of a pane. The code I have for accessing this is as follows but I cant seem to do anything with it once its highlighted;

Get-UiaPane -AutomationId '102' -Class 'VW32ANSI'

What is happening is once a button on the UI is pressed after a few seconds the pane is created and populated with content, I just need to be able to see that the pane has content - possibly to search for some test that is displayed inside the pane.

Im not sure if this is the best way forward to achieve this.

Please help!
Mar 4, 2015 at 11:15 PM
Hi cameronk,
as I understood, you can't access inner controls of the pane, right?
Have you tried UIAutomationSpy or UIA Verify to get its content? If these tools find something inside the pane, there is hope.

If you are asking HOW to get content, you can use the following samples, depending on what of these better works with your pane:
Get-UiaPane -AutomationId '102' -Class 'VW32ANSI' | Read-UiaControlName
# or another Read-UiaControl.... cmdlet, it outputs data as a string
# instead of getting the pane you can test for its existence, for example
Test-UiaControlState -SearchCriteria @{automationId="102";class="vw32ansi";[another property]="some value"}
# if there's a control inside pane, test for such a control
Get-UiaPane -AutomationId '102' -Class 'VW32ANSI' | Test-UiaControlState -SearchCriteria @{name="inner control name"}
# if your content is shown after an interval, there is a Wait-brother of the Test-UiaControlState cmdlet
Wait-UiaControlState -SearchCriteria @{automationId="102";class="vw32ansi";[another property]="some value"} -Seconds 30;
If the control highligher is your problem, simply turn it off:
[UIAutomation.Preferences]::Highlight = $false;
[UIAutomation.Preferences]::HighlightParent = $false;
Mar 10, 2015 at 1:22 AM
Hi, thanks for the info with UIA Verify!! I have found the only thing that seems to return from the pane is a slider bar so assume that the only thing that can be done is to use the panes' size/co-ordinates and work out where button clicks can take place.

Regards, Cameron.