Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Accessible Object and ComboBoxes
#1
I am trying to select items in several combo boxes on a tab in a windows 7 application.
I can click the tab using accessible objects, but I'm having a hard time understanding how to click and select the combobox item.
I've tried navigation from the Detail PAGETAB (for example: c1 c1) but this gives me an error when I click [test]
The find accessible object dialog navigation is as follows:
PAGETAB "Detail"
+++CLIENT "" ""
++++++TEXT "" ""
++++++PUSHBUTTON "Open"
+++STATICTEXT "First Occurrence Date:"
+++DROPLIST ""
++++++DROPLIST ""
+++STATICTEXT "Priority"
+++CLIENT
++++++TEXT ""
+++CLIENT
++++++TEXT "" ""
++++++PUSHBUTTON "Open"
...

Is there a way to navigate to the right combobox and enter the text?
Do you suggest another method?

Thank you!
#2
Attached snapshot of Find Accessible Object


Attached Files Image(s)
   
#3
Example with QM Options dialog, UAC combobox.
Macro Macro1981
Code:
Copy      Help
int w=win("Options" "#32770")
Acc a.Find(w "COMBOBOX" "" "class=ComboBox[]id=1571" 0x1005)
a.CbSelect("User") ;;or a.CbSelect(1)
Similar code should work with all standard combo box controls. Works with WindowsForms controls.

But in your object tree I don't see a COMBOBOX. Cannot capture it? Is it the DROPLIST?

When creating Navigate string, check "Show invisible" and "Show useless".
#4
I think it is the CLIENT role (for example, the text "GIVE NORMAL QUEUE" is what is currently selected in the combobox). Show invisible and show useless do not bring up additional items in the navigation pane.
#5
Use navigate c1 from PAGETAB. It finds the CLIENT. Then try CbSelect, like in my example.
#6
Object not found

int w=win("Trend Analysis and Corrective Actions" "WindowsForms10.Window.8.app.0.378734a")
Acc a.Find(w "PAGETAB" "Detail" "class=WindowsForms10.Window.8.app.0.378734a" 0x5 0 0 "c1")

Possible reasons and solutions:
1. Some property does not match. Try to clear or change some values.
2. The object or some object in the path is invisible. Try to check 'Search -> + invisible objects'.
3. Try to check 'Search -> + useless objects'.
4. Incorrect implementation of accessible objects in the window. Try to clear Class or some other value.
5. Try to capture other object and use Navigate.

OK
#7
Finds PAGETAB when without c1, but not found when with c1? Try to replace c1 to first.

Or capture the CLIENT. Does it find wrong object? Then try Match #. Or install QM 2.3.4, it supports WindowsForms control names.
#8
It finds the Details PAGETAB without issue, but it doesn't seem to find anything below that whether I navigate with C1 or first. First moves it to the first PAGETAB. I can't capture CLIENT, because the name changes when I change the combobox value.
#9
If name changes, don't use it.
#10
How do you recommend using QuickMacros to select an item in a Combobox other than using Accessible Objects?
#11
If it is standard combobox control, use CB_SelectItem. Acc.CbSelect uses it.
O use keys. Set focus with Tab keys or Acc.Select. Then Down Arrow.
#12
After selecting the Details tab, tabbing to each combobox works. Simple solution. Thank you.
#13
I found another method for doing this where tab does not work. For that case I did the following:

Function TACA_add_trend
Code:
Copy      Help
;;set Priority
scan "Priority.bmp" 0 0 1|2|16
mou+ 100 0
lef
key (Priority) "[]"

Essentially it scans for the "Priority" label, then mouses over 100 pixels, then left clicks (into the combobox), then types the priority (in the combobox).


Forum Jump:


Users browsing this thread: 1 Guest(s)