Jump to content

Recommended Posts

Posted

Hi,

I'm using UIAWrappers  to make a script to select combobox inside a window. The app is made using WindowsForms10

and the ProcessIdPropertyId changes every time i restart the app. while CLASS name is same for all combobox 

The only permanent field that I can use is $UIA_AutomationIdPropertyId. is there any way/example to use this in _UIA_action

 

 

Thanks

 

Posted
  On 1/6/2021 at 9:47 AM, FrancescoDiMuro said:

Sorry @dranzer006.
I am more familiar with UIASpy tool.
Could you please download it and post the UI Tree?
Otherwise, I am not of much help here (sorry again!) :)

Expand  

Here, I tried multiple ways (invoke, setfocus, click) however they don't select list box items directly . 

the only working solution I got was sending keyboard arrow keys directly to select, is there a better way to do this ?

 

 

Thanks

Untitled.jpg

Posted

@dranzer006
Well, from here you could try to get the handle of the ComboBox with ControlGetHandle(), using the $UIA_AutomationIdPropertyId as the "NAME" (The internal .NET Framework WinForms name) of the control;
otherwise, since the control supports theItemContainerPatter, maybee you can select the item with ItemContainerPattern.FindItem and select it from there :)

Click here to see my signature:

  Reveal hidden contents

 

Posted
  On 1/6/2021 at 10:52 AM, FrancescoDiMuro said:

@dranzer006
Well, from here you could try to get the handle of the ComboBox with ControlGetHandle(), using the $UIA_AutomationIdPropertyId as the "NAME" (The internal .NET Framework WinForms name) of the control;
otherwise, since the control supports theItemContainerPatter, maybee you can select the item with ItemContainerPattern.FindItem and select it from there :)

Expand  

Thanks for the help can you give an example ? 

on older versions I used ControlCommand with selectstring, However its not supported in new .net apps

 

 

Posted

@dranzer006
You should be able to see the ComboBox handle, and from there, we can operate in different ways:

  Reveal hidden contents

P.S.: you need to adapt the code to find the missing controls :)

Click here to see my signature:

  Reveal hidden contents

 

Posted

Note that the SelectionItemPattern is supported by the ComboBox control. The SelectionItemPattern is the correct way to handle selections. It's demonstrated in Example 11 of this post.

As the ComboBox supports the SelectionItemPattern, there is a good chance that the list items are also supported. Then check the properties of the listitems.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...