David_L Posted March 12, 2018 Report Share Posted March 12, 2018 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 ni.com) Thanks, ----- David Ladolcetta Certified LabVIEW Architect Cirrus Logic Quote Link to comment
PiDi Posted March 12, 2018 Report Share Posted March 12, 2018 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 1 Quote Link to comment
Zou Posted March 13, 2018 Report Share Posted March 13, 2018 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. 2 Quote Link to comment
hooovahh Posted March 13, 2018 Report Share Posted March 13, 2018 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. 1 Quote Link to comment
David_L Posted March 13, 2018 Author Report Share Posted March 13, 2018 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, David Quote Link to comment
infinitenothing Posted March 13, 2018 Report Share Posted March 13, 2018 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. Quote Link to comment
hooovahh Posted March 13, 2018 Report Share Posted March 13, 2018 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. Quote Link to comment
smithd Posted March 13, 2018 Report Share Posted March 13, 2018 at one point NI put effort into this...I never got around to using it but its always been on my list https://forums.ni.com/t5/NI-Labs-Toolkits/LabVIEW-UI-Automation-Tool/ta-p/3521765 The downside is that its clearly abandoned. But if it does what you need.. 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.