Sign in to follow this  
Followers 0
gigabyte

Unable to select a string from combobox

9 posts in this topic

#1 ·  Posted (edited)

Trying to use the following code to select a item from existing external application form dropdown but it just stays same. No change. Any idea what I am doing wrong

#Include <GuiComboBoxEx.au3>

WinWaitActive($title)

$Index = _GUICtrlComboBoxEx_FindStringExact($hcombo, $sText)

_GUICtrlComboBoxEx_SetCurSel($hcombo, $Index)

or following

WinWaitActive($title)

$Index = _GUICtrlComboBox_FindStringExact($hcombo, $sText)

_GUICtrlComboBox_SelectString($hcombo, $Index)

Urgent help

Edited by gigabyte

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

$hcombo = ControlGetHandle(...)

Yes doing it like this but it doesn't make any difference.

local $shcombo = ControlGetHandle($title, "", $hcombo)

local $sText = 'TQW - Q00C00'

WinWaitActive($title)

$Index = _GUICtrlComboBox_FindStringExact($shcombo, $sText)

_GUICtrlComboBox_SelectString($shcombo, $Index)

Please also find related links

and

Edited by gigabyte

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Post WHOLE RELATED code:

$hcombo = ...? ...
local $shcombo = ControlGetHandle($title, "", $hcombo)

#Include <GuiComboBox.au3>

#Include <GuiComboBoxEX.au3>

#include <GUIListBox.au3>

#include <GUIConstantsEx.au3>

;~#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator

global $hcombo = "[NAME:ctlMsgQueueCombo]"

global $hcomboclass = "[CLASS:WindowsForms10.COMBOBOX.app.0.2bf8098_r15_ad12]"

global $title = "Test Form"

global $index = 0

WinActivate ($title)

;Start test executable

Run("Z:\test\Info.Test\bin\Debug\Info.Test.exe")

sleep(6000)

controlFocus("", "", "[NAME:ctlSelector]")

controlsend("", "", "[NAME:ctlSelector]", 'QWER67')

sleep(1000)

local $shcombo = ControlGetHandle($title, "", $hcombo)

local $sText = 'TYY Processor (QWERYY980) - Q00S00'

$Index = _GUICtrlComboBox_FindStringExact($shcombo, $sText)

_GUICtrlComboBox_SelectString($shcombo, $Index)

Edited by gigabyte

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

CLASS:WindowsForms10.COMBOBOX.app.0.2bf8098_r15_ad12

This is not STANDARD Windows control. As far as I know it's DOTNET control.

Search this forum for questions/answers about automatizing DOTNET/WindowsForms.

EDIT: Autoit can work only with STANDARD controls.

Edited by Zedna

Share this post


Link to post
Share on other sites

This is not STANDARD Windows control. As far as I know it's DOTNET control.

Search this forum for questions/answers about automatizing DOTNET/WindowsForms.

EDIT: Autoit can work only with STANDARD controls.

At last the following code selects the desired item from list but after clicking the button it wont actually set the object ref

_GUICtrlComboBox_SelectString($shcombo, "TYY Processor (QWERYY980) - Q00S00")

sleep(3000)

$hButton = ControlGetHandle($title, "Submit", $hButtonCtrlId)

_GUICtrlButton_Click($hButton)

This code makes the desired selection and then clicks the button but actually the object ref was not set to that desired item. I searched for the dot net forums but couldn't find any thing that gives me a clue. PLz guide

Share this post


Link to post
Share on other sites

Search for WindowsForms

But My problem is it is successfully selecting the item from list as I can see but on back end it is not setting the object ref in application under test. I am unable to figure out how? As if I manually select I can see another combo box values being populated but in this case it selects the item but next combo is not updated so when It clicks the submit button ..Application says object ref not set. I also didn't get MSAA concept as I am a newbie. Please suggest. Need your help in this regard. If possible provide me some reference. I would be highly grateful.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0