How to run JavaScript?

I’m brand new to UI.Vision, coming from iMacros… and I’m confused.

I have a JavaScript (*.js) file that I am used to running by double clicking it from inside Firefox. That JavaScript file is basically the brains behind my automation. Then it uses things like iimPlay() from iMacros to screen scrape, extract data, fill forms, etc. (I’m using the old iMacros for Firefox JavaScript scripting interface.)

How do I replicate this setup using UI.Vision? I’ve read the iMacros migration tips, but I’m still not sure how to recreate the JavaScript brains. My JavaScript file is over 600 lines, so I can’t imagine recreating that with the UI.Vision Table View interface.

Thanks for any direction!

It took me a while to understand the question. The way I understand it now, your question is not how to run Javascript inside Ui Vision macros (this can be easily done with ExecuteScript), but how to recreate the “Javascript Scripting Interface” from iMacros for Firefox. It allowed you to play .js files (that use iimPlay etc) directly from the iMacros sidebar. This never even worked in iMacros for Chrome, only in older Firefox versions.

To migrate such code to Ui.Vision, I think the best solution is to recreate this Javascript .JS logic directly in the Ui.Vision commands. Ui.Vision needs no .JS file :slight_smile: → Because - unlike iMacros - Ui.Vision supports Selenium IDE compatible flow control. This means Ui.Vision supports IF/THEN decisions and looping directly inside the macro! So there is no need to use Javascript .js file for this.

Indeed not the best interface, but one gets used to it :laughing:

My hint is to use the “Arrow down” button to enlarge the table view:

image

Thank you for the reply and the tips! I’m beginning to recreate my code just as you suggested. :slight_smile:

I also just learned about UI.Vision subroutines, so that should help keep the code more maintainable.

1 Like