Set-UiaComboBoxText fails to set the correct value

Apr 21, 2016 at 8:33 PM
I'm trying to set an existing value in a combo box but it doesn't seem to be working.
$mainWindow | Get-UiaComboBox -AutomationId '5204' -Class 'ComboBox' -Name 'NewBinary12' -Win32 | Invoke-UiaComboBoxExpand | Set-UiaComboBoxText $state
It all works great except the $State isn't selected, any ideas on how to get the set value?
The combo box is a selection of states.
Powershell 5 with the netframework version 4 of uiautmation.dll
Coordinator
Apr 22, 2016 at 7:17 PM
Edited Apr 22, 2016 at 7:22 PM
Hi GScully,
if I understand your task well, you need to get a list item in the drop-down list of the combo and put it active. What I did to accomplish this in calculator's unit conversion page (now my localization is Spanish):
Get-UiaWindow -n *calc* -Win32 | Get-UiaComboBox -Name *selec* | Invoke-UiaComboBoxExpand | Get-UiaListItem -Name "Hora" | Invoke-UiaListItemClick
picture
Apr 25, 2016 at 7:22 PM
Thanks that worked perfectly