iowa Posted July 22, 2008 Report Share Posted July 22, 2008 Question: Is it possible to control applications run in windows XP from LabView, by emulating buttons clicks, reading visible text etc.. is it at all possible? I have our own C++ application used in embedded testing, instead of rewriting all functionality in LabView wanted to use originally created C++ application by hooking to Windows API and simulating buttons clicks driven by LabView as well as reading data from this C++ application (by LabView). Please help. Thank you,Alex[/size] Quote Link to comment
Omar Mussa Posted July 22, 2008 Report Share Posted July 22, 2008 QUOTE (iowa @ Jul 21 2008, 10:12 AM) Question: Is it possible to control applications run in windows XP from LabView Anything's possible... I know you can simulate clicks/keyboard presses but am not sure about reading visible text without serious effort. Here's a http://zone.ni.com/reference/en-XX/help/371361D-01/lvexcodeconcepts/ex_3_call_the_win32_api/' target="_blank">link with an example to calling Windows API functions. Someone's probably got a library with mouse/keyboard API calls for LabVIEW somewhere... Quote Link to comment
iowa Posted July 22, 2008 Author Report Share Posted July 22, 2008 QUOTE (Omar Mussa @ Jul 21 2008, 07:24 PM) Anything's possible... I know you can simulate clicks/keyboard presses but am not sure about reading visible text without serious effort.Here's a http://zone.ni.com/reference/en-XX/help/371361D-01/lvexcodeconcepts/ex_3_call_the_win32_api/' target="_blank">link with an example to calling Windows API functions. Someone's probably got a library with mouse/keyboard API calls for LabVIEW somewhere... I seen this NI.com article before.. I am looking for actual VI examples.. Used QTP to automate my testing before (same idea of using 3rd party applications to do the actual testing and all controlled from QTP).. Now trying to convert to using LabView and interfacing with 3rd party C++ applications by faking user actions (clicks/keyboard) is critical. Looking for examples.. Thank you! Quote Link to comment
MikaelH Posted July 22, 2008 Report Share Posted July 22, 2008 I'm using AutoIT-scripts compiled into exe-files that I run from LabVIEW. http://www.autoitscript.com/ //Mikael Quote Link to comment
iowa Posted July 22, 2008 Author Report Share Posted July 22, 2008 QUOTE (MikaelH @ Jul 21 2008, 10:52 PM) I'm using AutoIT-scripts compiled into exe-files that I run from LabVIEW.http://www.autoitscript.com/ //Mikael I tried it already BUT it is balky and consumes run time. I would like to have more elegant solution of using Windows API to emulate Clicks/Keyboard thus driving C++ test application directly from LabView. Still hope for Simple LabView WinAPI Example: such as code example of working with Calculator from LabView.. Thank you, Alex http://energyray.com - my collection of QA Tools Quote Link to comment
Mark Balla Posted July 23, 2008 Report Share Posted July 23, 2008 QUOTE (iowa @ Jul 21 2008, 05:06 PM) I tried it already BUT it is balky and consumes run time.I would like to have more elegant solution of using Windows API to emulate Clicks/Keyboard thus driving C++ test application directly from LabView. Still hope for Simple LabView WinAPI Example: such as code example of working with Calculator from LabView.. Thank you, Alex http://energyray.com - my collection of QA Tools I also use Auto It and love it. Mostly because it has Active X Drivers which make it work well with LabVIEW. I am planning to submit my AutoIt Vis to the CR sometime this year. I like the Idea of using the windows calculator as a demo example. I have posted my Win API set of keyboard emulation vis Here. There might also be some useful info Here. If you do come up with a usable set of Windows API vis please post them or put them in the CR. I know that many members would appreciate a good Windows API library. Quote Link to comment
iowa Posted July 23, 2008 Author Report Share Posted July 23, 2008 QUOTE (mballa @ Jul 22 2008, 04:50 AM) I also use Auto It and love it. Mostly because it has Active X Drivers which make it work well with LabVIEW. I am planning to submit my AutoIt Vis to the CR sometime this year. I like the Idea of using the windows calculator as a demo example. I have posted my Win API set of keyboard emulation vis Here . There might also be some useful info Here.If you do come up with a usable set of Windows API vis please post them or put them in the CR. I know that many members would appreciate a good Windows API library. Found this: Windows API Function Utilities (32-bit) for LabVIEW[/size]http://zone.ni.com/devzone/cda/epd/p/id/4935 These VIs make calls to the Windows Application Programming Interface (API) for managing and controlling windows (minimize, maximize, move, resize, rename, close, etc); managing applications (run application, quit application, print file, etc); adding and removing network resources; keyboard filtering; and system utilities (mouse cursor position, windows path, screen resolution, system path, etc). These VIs are intended for use only on 32-bit Windows platforms. And this: Thanks, Alex [/size] Quote Link to comment
iowa Posted July 24, 2008 Author Report Share Posted July 24, 2008 QUOTE (iowa @ Jul 22 2008, 04:21 AM) Found this:Windows API Function Utilities (32-bit) for LabVIEW[/size][/size] These VIs make calls to the Windows Application Programming Interface (API) for managing and controlling windows (minimize, maximize, move, resize, rename, close, etc); managing applications (run application, quit application, print file, etc); adding and removing network resources; keyboard filtering; and system utilities (mouse cursor position, windows path, screen resolution, system path, etc). These VIs are intended for use only on 32-bit Windows platforms. And this: http://zone.ni.com/reference/en-XX/help/37..._the_win32_api/ Thanks, Alex Any news or new feedback/ideas for this thread? I could really use working VI example which uses Windows API to control Windows Calculator.. Please ??? Quote Link to comment
Omar Mussa Posted July 24, 2008 Report Share Posted July 24, 2008 QUOTE (iowa @ Jul 23 2008, 11:54 AM) I could really use working VI example which uses Windows API to control Windows Calculator.. Its really unlikely that anyone is going to have the time or interest in building an example that controls the Windows Calculator... However if you feel it is worth your time to do this and post the resulting VI(s) to this thread, then other people will very likely look at your code and try to tell you how to improve it. Quote Link to comment
westjlittle Posted August 1, 2008 Report Share Posted August 1, 2008 Some of these actions can be done by using a GUI test program like TestComplete. We use it to verify our software products Jim Quote Link to comment
iowa Posted August 1, 2008 Author Report Share Posted August 1, 2008 QUOTE (westjlittle @ Jul 31 2008, 10:16 PM) Some of these actions can be done by using a GUI test program like TestComplete. We use it to verify our software productsJim The question was HOW to interact with 3rd party application's Front-End GUI directly from LabView (from VI file) by the use of Windows API.. TestComplete is another test automation tool similar to AutoIt or QTP.. This is not what I was looking for... Quote Link to comment
JDave Posted August 2, 2008 Report Share Posted August 2, 2008 QUOTE (iowa @ Jul 31 2008, 03:22 PM) The question was HOW to interact with 3rd party application's Front-End GUI directly from LabView (from VI file) by the use of Windows API..TestComplete is another test automation tool similar to AutoIt or QTP.. This is not what I was looking for... Is there some reason you have to do all the Windows API work yourself? I thought the suggestion of using compiled AutoIt scripts was quite nice. AutoIt does all the API work and you just run the exe from your VI. Is there a reason this doesn't work for you? Quote Link to comment
Karissap Posted August 2, 2008 Report Share Posted August 2, 2008 You should be able to use the Microsoft UI Automation libraries. There are examples in other languages Here if you can translate them to LabVIEW. There is also an article about using it for testing a user interface I had a go at it but didn't get very far, here's what I got before I got stuck. Download File:post-8228-1217545423.vi Quote Link to comment
iowa Posted August 2, 2008 Author Report Share Posted August 2, 2008 QUOTE (JDave @ Jul 31 2008, 10:45 PM) Is there some reason you have to do all the Windows API work yourself? I thought the suggestion of using compiled AutoIt scripts was quite nice. AutoIt does all the API work and you just run the exe from your VI. Is there a reason this doesn't work for you? Yes there is a reason.. The LabView project I work with executes millions of the software / hardware tests and adding Windows API interfacing ability to "hook" into another 3rd party (C++) application will let me enhance already existing test coverage by reusing another application's functionality... Using AutoIt will not be as elegant or as fast because of the big number of buttons I will have to interact with ... expect on average to click 1-3 million of buttons every 24 hours.. Direct interfacing from LabView by the use of Windows API will let me do it directly and faster without the need for huge library of AutoIt executables. BTW -- found some working Windows API examples on NI.com (library of VIs for opening applications, resizing, moving, clicking etc..) Quote Link to comment
CaseyM Posted August 2, 2008 Report Share Posted August 2, 2008 QUOTE (iowa @ Jul 31 2008, 04:19 PM) Yes there is a reason..The LabView project I work with executes millions of the software / hardware tests and adding Windows API interfacing ability to "hook" into another 3rd party (C++) application will let me enhance already existing test coverage by reusing another application's functionality... Using AutoIt will not be as elegant or as fast because of the big number of buttons I will have to interact with ... expect on average to click 1-3 million of buttons every 24 hours.. Direct interfacing from LabView by the use of Windows API will let me do it directly and faster without the need for huge library of AutoIt executables. BTW -- found some working Windows API examples on NI.com (library of VIs for opening applications, resizing, moving, clicking etc..) If you're familiar with TestStand there's a toolkit available on justTESTtoolkits.com: http://www.justtesttoolkits.com/toolkit-details.php?id=167 You can always try requesting a toolkit there as well. Quote Link to comment
Rolf Kalbermatter Posted August 2, 2008 Report Share Posted August 2, 2008 QUOTE (iowa @ Jul 21 2008, 06:06 PM) I tried it already BUT it is balky and consumes run time.I would like to have more elegant solution of using Windows API to emulate Clicks/Keyboard thus driving C++ test application directly from LabView. Still hope for Simple LabView WinAPI Example: such as code example of working with Calculator from LabView.. I'm doubt you find it. Automating user interface testing on a Windows API level is absolutely not trivial (hence contradicts your requirement of simple LabVIEW examples) and is the reason there exist software packages like AutoIt. If you really hope to build an extensive UI testing framework for non-LabVIEW applications don't go and try to use LabVIEW for it. Of course it can be done as there is virtually nothing that couldn't be done in LabVIEW if it can be done in a program at all, but it is going to be a major pain in the ######. Feel free to research the Windows API on MSDN and proof me wrong but asking for simple examples here is not likely to give you anything useful. Rolf Kalbermatter Quote Link to comment
iowa Posted August 2, 2008 Author Report Share Posted August 2, 2008 QUOTE (rolfk @ Aug 1 2008, 09:19 AM) I'm doubt you find it. Automating user interface testing on a Windows API level is absolutely not trivial (hence contradicts your requirement of simple LabVIEW examples) and is the reason there exist software packages like AutoIt.If you really hope to build an extensive UI testing framework for non-LabVIEW applications don't go and try to use LabVIEW for it. Of course it can be done as there is virtually nothing that couldn't be done in LabVIEW if it can be done in a program at all, but it is going to be a major pain in the ######. Feel free to research the Windows API on MSDN and proof me wrong but asking for simple examples here is not likely to give you anything useful. Rolf Kalbermatter As posted before, already found some of the basic Windows API examples from NI.com. The AutoIt is useless when someone have to deal with 100s of different interactions... would you really prefer to fire array of 100s of executables created in AutoIt instead of robust LLB with VIs using actual Windows API "hooks" controlling 3rd party application? As for not using LabView statement: In scope of any complex LabView implementation there is a BIG benefit from using 3rd party applications to supplement LabView coverage. In my case I implemented hooks into 3rd party GUI and it is working.. not perfect but working.. When time permits will be expanding my LLB by adding new "hooks". Thanks to all who responded to my questions with actual answers & ideas. It helped to get started on this. Quote Link to comment
Mark Balla Posted August 2, 2008 Report Share Posted August 2, 2008 QUOTE (iowa @ Aug 1 2008, 09:19 AM) would you really prefer to fire array of 100s of executables created in AutoIt instead of robust LLB with VIs using actual Windows API "hooks" controlling 3rd party application? Exe scripts are not the only way to use AutoIT!!! If you look on their webpage. it says they have DLL and COM (ActiveX) control. After AutoIT is installed you can access the functions using the Active-X Open and Invoke nodes Here is how to use AutoIT in LabVIEW Here are some vis to get you started. Download File:post-584-1217621205.zip Quote Link to comment
iowa Posted August 2, 2008 Author Report Share Posted August 2, 2008 QUOTE (mballa @ Aug 1 2008, 08:14 PM) Exe scripts are not the only way to use AutoIT!!! If you look on their webpage. it says they have DLL and COM (ActiveX) control. After AutoIT is installed you can access the functions using the Active-X Open and Invoke nodes Here is how to use AutoIT in LabVIEW Here are some vis to get you started. This is super nice.. Thank you !!!! http://energyray.com 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.