Jump to content

Unable to select a string from combobox


Recommended Posts

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
Link to comment
Share on other sites

$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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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

Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

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