callagga Posted August 25, 2009 Share Posted August 25, 2009 Hi, I'm getting stuck trying to set the selection for a combobox. Is there something I'm missing? Code is below. Note the "ShowDropDown" works, but the "GetCurrentSelection" does not, nor does the "GetCurrentSelection". I also not when I use "AutoIt v3 Window Info" and target the combobox I see black under the Control Text, nor can I find anywhere in the Text where I can read all the combobox drop down text values? Any ideas? $windowTitle = "[CLASS:WFC.window.8]" Opt("WinTitleMatchMode",4) ;Advanced Search Mode WinActivate ($windowTitle) ControlCommand ( $windowTitle, "", "[CLASS:WFC.COMBOBOX; INSTANCE:1]", "ShowDropDown") ; ==> WORKS ControlCommand ( $windowTitle, "", "[CLASS:WFC.COMBOBOX; INSTANCE:1]", "GetCurrentSelection") ; ==> DOESN'T WORK. GIVES A RETURN VALUE OF 0 (even though I can see 'Closed' selected in the Combo box) ControlCommand($windowTitle, "", "WFC.COMBOBOX1", 'SelectString', 'Open') ; ==> DOESN"T WORK Thanks Link to comment Share on other sites More sharing options...
callagga Posted August 25, 2009 Author Share Posted August 25, 2009 PS. If there's some reason why I will not be able to use ControlCommand, and instead have to use Send, then what is the command to get the combobox focus/active set so I can then just send the first character (e.g. Send("o"))? Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 25, 2009 Share Posted August 25, 2009 PS. If there's some reason why I will not be able to use ControlCommand, and instead have to use Send, then what is the command to get the combobox focus/active set so I can then just send the first character (e.g. Send("o"))?You would use ControlSend(), not Send() for better reliability. You could ControlFocus() first, but it probably isn't required. >_< Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
callagga Posted August 25, 2009 Author Share Posted August 25, 2009 You would use ControlSend(), not Send() for better reliability. You could ControlFocus() first, but it probably isn't required.thanksIs winactivate sometimes required here? Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 25, 2009 Share Posted August 25, 2009 thanksIs winactivate sometimes required here?For Send(), yes. Not for ControlSend(), which even works on most minimized windows. >_< Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
vimala Posted September 5, 2009 Share Posted September 5, 2009 hello sir/madam MouseMove(527,523) MouseDown("left") MouseUp("left") $value12=$val12[$j];this value iam getting from excel sheet Controlsend("ClearVision_V1.8.9.0","","WindowsForms10.COMBOBOX.app.0.378734a1",$value12) send("{TAB}") iam using excel sheet to get values and print in the .net application.iam getting correct value from excel sheet. But while printing in combobox the value selected is last letter value.why this is happening? example Bangladesh :value from excel sheet value printed in combobox is haiti i have checked with all control commands. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now