Ui.Vision 10 Beta — AI macro creation and new real browser clicks that need no focus

the uiv.run(‘run’, ‘my_script.js’); is not working.

the calling script is executed. the called script is not

Issue confirmed.

uiv.run(‘run’, ‘my_script.js’) cannot work from a JS script: the classic run command pushes the called macro onto the classic player’s call stack and relies on the player’s main loop to execute it — but a script’s uiv.run calls are one-shot mini-runs, so the frame is pushed and never played (and for a called .js macro there are no Commands at all — its program lives in Script). The call “succeeds” silently, which matches the report exactly. With the next update we will report a proper error.

=> Solution:

This works already now: Replace the uiv.run(‘run’, …) line with an @include of the shared macro and call its function.

Example:

@incluse is very powerfully.

i have started to use it like “import” in java. life mush easier now

The uiv.exportToDownloads(fileName); is not removing browser stored file after download

I’m on UI.Vision 10.0.101 (Chrome extension). Whenever I click “+ Macro” and give it a name, it automatically creates a .js script macro — even though I just type a plain name with no extension.

Because of this, the Table View and Source View (JSON) tabs are greyed out, with the tooltip: “This is a JS script macro — the Table and Source views edit command-table macros.”

My question: is there still a way to create a new command-table macro directly from the “+ Macro” dialog in v10, or has that dialog been changed to only create JS macros now?

@108_MIX See here: Create classic macros with V10

You’re right, thanks for the hint → we fixed this gap with todays V10.0.105 release.

Solution:

A new command uiv.files.remove(name) was added, alongside uiv.files.list() and uiv.files.exists(name) - they take any stored name, .png, .csv or .txt alike:

So in your case:

uiv.exportToDownloads('results.csv');
uiv.files.remove('results.csv');

PS: In classic table macros, localStorageExport | results.csv | #DeleteAfterExport still works exactly as before.

not working

Do you already have version V10.0.105? If not, you can force an update and then retest.

not able to extract attribute

@Eltal can you please post a test macro with this issue? Then we can debug it.

const dbgMode = true;

/** ====== myMethod  ==================================== //
*/
function myMethod (elementsLocator, elementsAttribute, the_msg="Extracting attribute"){
uiv.open('
');
if (dbgMode === true || dbgMode === 'true')   { uiv.log( -- DBG: ${the_msg}); }
// code here
uiv.log(Will extact value of the an Attribute [${elementsAttribute}] from [${elementsLocator}], "");

const elementObj = uiv.$(xpath=${elementsLocator});
const runningStatus = elementObj.getAttribute(elementsAttribute);
uiv.log(WE R DONE, "");
}
const resultTableRowXpath = //table[@class="table table-bordered"][1]/tbody/tr[1];
myMethod(resultTableRowXpath, "class") ;
/* unit test
*/ // unit test
// == END: myMethod() ==================================== //