My first suggestion is to add some Highlights to see whether everything lights up correctly:
Code: Select all
;'open' 2nd combobox & select option based on value of 1st combobox
y.WaitElement({Type:"ComboBox", Name:"Case Closed Reason",cs:0,mm:2}).Highlight().Invoke()
Switch statuss
{
case "Stage 1": y.WaitElement({Type:"ListItem", Name:"Paid Stage 1"}).Highlight().Invoke()
case "Stage 2": y.WaitElement({Type:"ListItem", Name:"Paid Stage 2"}).Highlight().Invoke()
case "Stage 3": y.WaitElement({Type:"ListItem", Name:"Paid Stage 3"}).Highlight().Invoke()
case "Stage 4": y.WaitElement({Type:"ListItem", Name:"Paid Stage 4"}).Highlight().Invoke()
case "Stage 5": y.WaitElement({Type:"ListItem", Name:"Paid Stage 5"}).Highlight().Invoke()
case "Stage 6": y.WaitElement({Type:"ListItem", Name:"Paid Stage 6"}).Highlight().Invoke()
}
MsgBox "done"
Also, are you sure that Invoke() is correct there? Comboboxes often have Expand() available, and ListItems may have Select(). They may have different effects than Invoke().
Fyi, I don't recommend UIA for browser automation. It is much more reliable to use Chrome.ahk, Rufaydium, or write your own browser plugin instead.