10-16-2015 10:25 AM - edited 10-16-2015 10:35 AM
Ah, yeah, the code will continously click every time the Elapsed Time outputs a True value. You can make it only do it once if you disable the Auto-reset feature on the Elapsed Time express VI AND ADD LOGIC SO THE CODE ONLY EXECUTES THE FIRST TIME TIME ELAPSES.
This code should really only be used as a guideline to show you how you can click somewhere on the page. Your own code shouldn't function this way. (This code is actually really dumb because it didn't work for me. It should pull the coordinates of the OK button instead of hard-coding a coordinate value in. And like altenbach said, continuously clicking is a horrible user experience.)
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
10-16-2015 10:25 AM
I am trying to trying to write an automated test (through Teststand) to validate a tool that we use. I would like the ability to click on different areas of the tool (i am trying to validate). This is where my NI contact directed me to...
10-16-2015 10:33 AM - edited 10-16-2015 10:34 AM
@James.M wrote:
You can make it only do it once if you disable the Auto-reset feature on the Elapsed Time express VI.
Noooo! Don't do that! If you disable autoreset, it will remain true forever after the time has elapsed once, meaning it will start moving the mouse withe every loop iteration, i.e. every 10 ms, probably making the VI completely unusable. 😞
As I said above, don't write code that moves the mouse around. There are better ways to achieve what you need.
10-16-2015 10:37 AM - edited 10-16-2015 10:55 AM
Oops. Yeah, if you disable auto-reset, add other logic to only run the clicking code the first time it elapses.
Tip: Ctrl + "." will force quit your VI if I caused you to lock it up.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
10-16-2015 10:47 AM
What other better ways do you know of? Keep in mind i'm using testtand to write my test code which is why I thought simulating a mouse click through a VI was a better option
10-16-2015 10:55 AM - edited 10-16-2015 11:14 AM
There are many ways to operate a control programmatically. warping the mouse is probably not something thet comes to mind first.
I am not familiar with teststand and why you would need to do this, but if it were a common and recommended usage pattern, it would be built-in.
10-16-2015 11:02 AM
Several folks have written "abort.vi". The one I wrote is here.
10-16-2015 11:50 AM
@dks2710 wrote:
I am trying to trying to write an automated test (through Teststand) to validate a tool that we use. I would like the ability to click on different areas of the tool (i am trying to validate). This is where my NI contact directed me to...
What is this tool? Do you have to go through this special software or can you send it commands on your own?
10-16-2015 01:01 PM
If the tool is written using standard Windows interface objects, I'd recommend using AutoITscript, which has an ActiveX interface called AutoITX. You can use it to send "click" commands to buttons and such by using the name of the button instead of by moving the mouse around.
I've used it before in LabVIEW when interfacing with a 3rd-party application that normally communicates over TCP/IP even though it runs on the local machine, but has some functionality that wasn't working remotely but was working on their manual interface.
10-16-2015 01:19 PM
@Kyle97330 wrote:
If the tool is written using standard Windows interface objects, I'd recommend using AutoITscript, which has an ActiveX interface called AutoITX. You can use it to send "click" commands to buttons and such by using the name of the button instead of by moving the mouse around.
I've used it before in LabVIEW when interfacing with a 3rd-party application that normally communicates over TCP/IP even though it runs on the local machine, but has some functionality that wasn't working remotely but was working on their manual interface.
Holy crap, thank you. I have a program running on my home computer that automatically downloads some torrents for me (100% legal, no need to look over here). and I've been using AutoIt to interface with my torrent client by just clicking in specific locations and using keystrokes... This would make it 100% more reliable.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'