Instead of saving the results to a CSV file, can I use MySQL instead and insert the records directly to my database?
You can connect to MySQL via a local script (Node.js, Python, VBS,…) that you call with XRun.
We’re doing option 2 (via Node.js script via command line API) but the sample script on GitHub has a timeout.
Our macros doesn’t have a constant time when it will be finished – some will take 30 seconds, some will take a longer period so using a timeout on our case isnt advisable. Instead of timeout deciding if our run is completed, how would we know if the process initiated by the API starts UI Vision and when the process counts as finished? Is there an internal variable that we can use?
Good question. I suggest to do it as in the sample scripts: UIVision creates a log file when done. You can watch for this log file to appear. This will tell you when the process has finished.
The timeout in the Node.js (and other) scripts is only to prevent endless waiting in case “something” happens to UIVision or the browser, e. g. for the rare case when the browser or UIvision freezes or crashes. So you can make this timeout very long, longer than your longest process will never need.
how would we know if the process initiated by the API starts
There is no feedback for the start of the browser. But if you want, you could make your macro write a CSV file to check. But I do not think that is needed.
… and when the process counts as finished?