Jump to content

Verification point for ComboLBox elements


MSGanesh
 Share

Recommended Posts

Hello Everyone,

I have an application which is designed using Qt framework. My intention is to automate this Qt application using AutoIt tool. I have reached to a point where in I was able to get the control of Combobox list widget(ComboLBox). In this Combobox widget I was able to change the elements using SEND{DOWN} command. Once the elements in combobox is changed I want to verify whether the change has taken place(as a verification point). In order to verify, I know that if somehow I can get the instance(i.e. ControlID) of element then I can verify the changes in the ComboBox. But sadly I was not able to get the instance of any element. So is there any way which would help me to get the instance of each class which could be used as a verification point?

Even if I can get the text of elements in the combo box, that would be fine(tried with ControlCommand(GetCurrentSel) which was an unsuccessful attempt)

NOTE: Text and handle remains same for all the elements within the combo box list. So these parameter cannot be used as VP.

Also I think _GUICtrlComboBox_GetCurSel will not work as GUI is not a user defined one.

Thanks and Regards,

MS

Link to comment
Share on other sites

Try this:

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Link to comment
Share on other sites

Thanks funkey for sending the link and pardon me for the delayed response.

Coming back to the issue, in my case all the combo box elements have the same HandleID and Control Instance is the only thing that varies. The script that is mentioned in the link uses ControlGetHandle to get the handle of the control widget. In the similar fashion I am looking for a function which would return Control Instance ID so that I can use Control Instance ID as a verification point.

Link to comment
Share on other sites

_GUICtrlComboBox works besides the GUI is your own GUI or not... I don have any idea of Qt framework, maybe the AutoIt Wondow Info Tool can tell you the instance... the instance is always the same.

It sound rare to me that the handle is unique for each control in a window.

If you have the handle you can try _WinAPI_GetDlgCtrlID()

Edited by monoscout999
Link to comment
Share on other sites

OK. Let me put it across in a different way which would give further detail about my issue.

Assume a GUI window which has a combo box widget and a button widget. Now the handle for combo box and button widget are certainly different. But combo box contains drop down list which has say 10 options to select and changing these option will not change the handle id but only Control Instance will change. So once I change the option in the combo box I need to get the Control Instance which can be put as a Verification point. I hope this could give better understanding of the issue.

Using _WinAPI_GetDlgCtrlID() won't be of much help as AutoIT window info tool was not able to find the Control ID of combobox widget.(Using the function also returned 0x00000 for the widget).

Link to comment
Share on other sites

How do you know that the instance is the only thing that change? i didn`t think so because if the handle is the same then is the same control, the ComboBox must have Items not but all belong to the ComboBox... Did you read well the Topic that @funkey link to you? try to using that tool.... look for some way or getting the items of a combobox.

Link to comment
Share on other sites

It have the shape of a ComboBox but this is not an ordinary ComboBox, i never work with QWidgets before... Ussualy the intance of the Controls in a GUI is the same every time you run the application.

You can try this to check if the control is being visible or not.

$State = ControlCommand("Sessions Settings Dialog", "", "[CLASS:QWidget;INSTANCE:24]", "IsVisible") ; For Current Time-base profile Item from the COMBOBOX.
If $State = 1 then
    ConsoleWrite("Is Visible"&@CRLF)
Else
    ConsoleWrite("Not Visible"&@CRLF)
EndIf

Looking this You will find more ideas of how to get the exact control.

Link to comment
Share on other sites

Script works fine. For ControlCommand("Sessions Settings Dialog", "", "[CLASS:QWidget;INSTANCE:24]", "IsVisible") it returned Not Visible in the Console Output.

Even called ControlEnable("Sessions Settings Dialog", "", "[CLASS:QWidget;INSTANCE:24]"), which also failed. But calling ControlClick works fine.

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...