Jump to content

Object Names for controls in Squish (GUI Tester)

Recommended Posts

Hey all,


Pretty obscure question here, hopefully someone out there has some ideas.  Our testing team uses a GUI testing tool called Squish.  You use this tool to record GUI interactions so you can automate mouse clicks, etc.  For software written in other languages (for example, Notepad++) Squish will refer to an object by a name or ID.  This allows the test to work no matter the resolution, location or size of the window.  For example:.  


function main() {
    mouseClick(waitForObject(":Open_Edit"), 312, 8, MouseButton.PrimaryButton);
    type(waitForObject(":Open_Edit"), "asdf");
    mouseClick(waitForObject(":_Pane_2"), 318, 161, MouseButton.PrimaryButton);
    type(waitForObject(":_Pane_2"), "asdf");

However for a LabVIEW application, Squish does not seem to assign any name to the controls(however window names are assigned), and instead refers to the object by relative location:


function main() {
    doubleClick(waitForObject(":David_VI.vi_Window"), 38, 150, MouseButton.PrimaryButton);
    doubleClick(waitForObject(":David_VI.vi_Window"), 35, 199, MouseButton.PrimaryButton);
    mouseClick(waitForObject(":David_VI.vi_Window"), 183, 167, MouseButton.PrimaryButton);
    mouseClick(waitForObject(":David_VI.vi_Window"), 44, 37, MouseButton.PrimaryButton);
    mouseClick(waitForObject(":_Pane"), 45, 12, MouseButton.PrimaryButton);
    mouseClick(waitForObject(":David_VI.vi_Window"), 170, 224, MouseButton.PrimaryButton);
    mouseClick(waitForObject(":David_VI.vi_Window"), 470, 16, MouseButton.PrimaryButton);

So the question is does anyone know how to assign these Object IDs for LabVIEW controls?  It seems to be defined by the application, not by Squish.  Has anyone used Squish (or similar tools) for GUI automation of LabVIEW applications and had success?


(Cross post on ni.com)


David Ladolcetta
Certified LabVIEW Architect
Cirrus Logic

Link to comment

I've been playing a bit with AutoIT (https://www.autoitscript.com/site/autoit/). But I've faced the same problem - there is no way, other than screen coordinates, to refer to any GUI items in LabVIEW. What exactly are those "Object IDs" and where do they come from, and why they are not present in LabVIEW - those questions are beyond my knowledge. But if someone was succesfull with GUI testing in LV, I'd be interested to hear that too :)

  • Like 1
Link to comment

Because LabVIEW doesn't use Windows objects, so LabVIEW controls have no object ID.

Only LabVIEW knows where the controls are.

To OS & other applications, there is nothing on the front panel.

Only 2 exceptions: ActiveX & .Net containers.

The containers are child windows.  Therefore they should have an object ID.


  • Like 2
Link to comment

Zou is probably right.  LabVIEW does a lot of nonstandard things in their UI drawing, likely so they can be more easily crossplatform with Mac and Linux.  Have you thought about possibly leveraging a LabVIEW EXE to get information about the position of other controls?  I could imagine a LabVIEW EXE that opens an application instance to an already running EXE, and then get reference to VI front panel, then references to the controls themselves.  It might be possible at that point to get the position of a control, based on the control label in the VI.  Then it might be possible for your tool to get the positioning of a control, based on the name.  But at that point one could make the argument to just use LabVIEW to control LabVIEW.  Nothing sounds like a good solution.

  • Like 1
Link to comment

Darn, that's a bummer.  Thanks to both of you.  I did consider the option to use VI Server to automate these things, but that would mean creating a custom LabVIEW tool to replace something that already exists and our team is already familiar with.  Agreed that there doesn't seem like a good solution, but maybe someone else out there will have some secret ideas that we don't know about :-)

Thanks again,

Link to comment
14 minutes ago, infinitenothing said:

Even VI server is going to have some drawbacks like accessing latching booleans and whatnot. If anyone has and idea exchange post in support of automated GUI test, I'd kudos it.

Oh yeah I wasn't suggesting performing the value change on the booleans.  I was suggesting getting the coordinates, then performing a mouse move, and mouse click, sicne I assume squish does the same thing more or less.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.