Sign in to follow this  
Followers 0
MSGanesh

Verification point for ComboLBox elements

15 posts in this topic

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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

_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

Share this post


Link to post
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).

Share this post


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

Share this post


Link to post
Share on other sites

I verified using AutoIt Window Info tool . Even tried using Ranorex Spy tool. But the result was the same as mentioned in earlier posts.

Share this post


Link to post
Share on other sites

can you post what you get with that tools?, and post what you get when you hover an item of that ComboBox.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Please find the attached screenshot when hovered on same combobox using Auto IT window info tool.

post-66929-0-26410300-1315198574_thumb.p

post-66929-0-32790300-1315198614_thumb.p

Edited by MSGanesh

Share this post


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

Share this post


Link to post
Share on other sites

The control is not visible. ControlEnable() function itself fails. Provided sufficient delay but the result is the same.

Share this post


Link to post
Share on other sites

What you mean with the control is not visible? please provide more context... the script works fine? Did you read the console output?, Did you try with the real state of the control visible and not?, please i really need to know more context of everything.

Share this post


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

Share this post


Link to post
Share on other sites

Did you try ControlCommand("Sessions Settings Dialog", "", "[CLASS:QWidget;INSTANCE:24]", "IsVisible") when the control is visible for Real(when you select that specific item)?

Share this post


Link to post
Share on other sites

Yes. I tried calling ControlCommand when the control is Visible for Real but in the Console output function returned "Not visible".

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