01-30-2021 12:52 PM
I have an application (running by Labview Source code or executable). There are many steps need click button, enter string on the UI or dialog to run this end to end.
I need do these steps manually by mouse click and enter on keyboard. But I need run these steps many time which is boring, time consuming and easy to make mistake.
I'd like to write a tool (Labview) to automate above steps by simulate button click and string enter. Is there any example or existing tools I can use ?
01-30-2021 01:48 PM
If you have the source code as you seem to indicate, why not just modify the code to allow it to run without user interaction?
01-30-2021 04:35 PM
Because I need to run regression test on the executable to make sure the application response correctly to the user actions.
Also I need separate the application source code and the new test code I am going to write, because user only need the application executable which has human interaction (mouse click, keyboard enter).
01-30-2021 06:47 PM
Depending on the structure of the code you should be able to test the core functionality of the application without user interation. If your application separates the business logic from the UI, you can fully test the functionality using automation and not require user interaction. Yes, you do need to test the UI as well but that is a different type of tool. There are third party tools for automating GUI but they tend to be very brittle. Many rely on screen coordinates to activate your UI components and require lots of maintenance as the application changes over time.
There is no pure LabVIEW way to accomplish what you want. Best approach is to structure your code such that core functionality can be tested/simulated without the the UI interaction. This will verify the majority of your application. Final UI testing would require a user but if everything under the hood is working, the UI testing should be to bad.
01-30-2021 07:14 PM
I just need an example vi or tool can do following automatically instead of mouse click and enter keyboard:
1. Detect the application window, click one of the buttons on it.
2. Fill out the blank try on the window. (I already have vi can read strings from file).
In the test, I have to repeat hundreds of times of above 2 step with click different button, enter string. Now I do it manually which is boring and time consuming. I have some vi to read string from file, decide which button to click.
Just need to integrate with other Labview code which can perform button click and string enter on the dialog.
01-31-2021 01:46 PM
I am looking for a tool/code like "Auto Clicker" to repeat hundreds of click automatically.
But if there is Labview code can do similar job, I can integrate that code into my Labview which will be great.
01-31-2021 02:03 PM
No, LabVIEW does not have that capability. It is a programming language. I suggested ways you can structure your application to make automated testing easier. It won't eliminate th eneed to verify the UI but a large portion of your application could be tested using various frameworks within LabVIEW such as the Unit Test framework.
If you need a something to simulate user interactions you will need to find other tools.
01-31-2021 02:41 PM
In Labview, is there an example how to get the handle/ref of a running window/dialog ?
And get the ref of the 3 buttons on that dialog, then simulate click one of the 3 buttons ?
02-06-2021 08:46 PM
there are examples of simulating keyboard presses and mouse interactions.https://forums.ni.com/t5/Example-Code/Programmatically-Simulate-Key-Strokes-in-LabVIEW/ta-p/3521756?...
Now I only need example Labview code to get the handle/ref of the running app/window/dialog (Labview executable), so I can simulate key press on that app/window/dialog
02-08-2021 03:19 AM
If you made the exe, it can be quite simple.
Make a VI that uses VI server to get a reference to he VI, use value change events to type text\press buttons.
This can be a piece of cake, or it can be very, very hard. Pressing a button is trivial, unless the button is set to latch. Then it's not possible to use a value signaling. You'll have to get it
s position and use the OS to simulate a click. Getting the position can be very, very hard. For instance the button can be in a clone, the clone can be in a subpanel, the subpanel can be in a clone, in a subpanel.
Anyway, if you drop the VI on the running executable, it will be loaded, and it can be run (automatically). This way, you can add functionality to your executable.
If you design the Vi to accept data from a named pipe or TCP\IP connection, you can tell it wat to do from outside the executable.