LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Object Names for controls in Squish (GUI Tester)

Solved!
Go to solution

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() {
    startApplication("notepad++");
    mouseClick(waitForObject(":41001_ToolbarItem"));
    mouseClick(waitForObject(":41002_ToolbarItem"));
    mouseClick(waitForObject(":Open_Edit"), 312, 8, MouseButton.PrimaryButton);
    type(waitForObject(":Open_Edit"), "asdf");
    clickButton(waitForObject(":Open.Cancel_Button"));
    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() {
    startApplication("DavidApp");
    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 LAVA)

 

Thanks,
-----
David Ladolcetta
Certified LabVIEW Architect
Cirrus Logic

0 Kudos
Message 1 of 4
(2,176 Views)
Solution
Accepted by topic author David_L

As Goerge Zou already pointed out on Lava, LabVIEW does not use Windows controls for its widgets but does the entire drawing of the front panel on its own. This means as far as Windows is considered, a LabVIEW front panel is a window that only has random pixel lines on it.

 

Normal Windows controls are in fact implemented as individual child windows of the main panel (Form, window, or whatever the actual widget framework likes to call them). The controls all have an ID which can be used by automation tools but no such thing exists for LabVIEW controls. So the location of a mouse click relative to the user area of the front panel is the only thing that such a tool can use, unless you want to go through the trouble of creating an interface library for your automation tool that uses VI Server to access controls on a front panel.

Rolf Kalbermatter
Averna BV
Message 2 of 4
(2,111 Views)

Thanks Rolf.  I was hoping this wasn't the answer, but at the same time expecting it.  Looks like we'll have to go with workaround unless anyone else has some secret other ideas.

 

Cheers,

David

0 Kudos
Message 3 of 4
(2,088 Views)

You can call LabVIEW stuff from other programming languages using ActiveX.  I haven't done much with it but here's an example using VB.

 

Not sure how deep into the rabbit hole you can go with doing things like finding button locations and so on, though...

0 Kudos
Message 4 of 4
(2,032 Views)