Error Can't find macro with name "name" when run command line

Hello there,

I try to run a macro ui.vision with a bat file through command line on windows.

When I run the command, ui.vision is opened but with an error

Can’t find macro with name “C:\Users\MYUSER\Desktop\git\ui-vision-test-automation-2\myProject\macros\myDepository\LoginBasicUser.json”

UI.Vision is opened with storage mode in “file system (on hard drive”) instead “local storage (in browser” : so the macro is not find.

How to slove this problem ?
Have I to do anything to open ui.vision in browser storage mode, or have I to do anything into my command line, OR into my ui.vision.html file, OR into the.bat file to ensure it’s work fine ?

The file path is the same into .bat file and into ui.vision repository…

The code into .bat file :

set repertoire=C:\Users\MYUSER\Desktop\git\ui-vision-test-automation-2\myProject\macros\myDepository\

set fichier1=LoginBasicUser.json

set htmlFile=file:///C:\Users\MYUSER\Desktop\git\ui-vision-test-automation-2\myProject\ui.vision.html

"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "%htmlFile%?storage=xfile&macro=%repertoire%%fichier1%&direct=1&savelog=log1.txt" 

Thanks in advanced

This is wrong you must add only macro name without .json

set fichier1=LoginBasicUser.json

It doesn’t change anything…

In my test cmd working well there is a error in your command line batch file

Try with regular command line

Here info

https://ui.vision/rpa/docs#cmd

1 Like

Hi, I see that you are using storage=xfile - this is correct. But please note that even with xfile active, UI.Vision can only find macros that are within the UI.Vision root folder(*).

So if your XModule root folder is for example:

C:\software\rpa\ then the macro root folder is automatically

C:\software\rpa\macros

Thus you can use

  • storage=xfile&macro=macro%20name1 (if the macro is at “C:\software\rpa\macros\macro name1.json”)
  • storage=xfile&macro=\folder1\folder2\macro%20name1 (if the macro is at “C:\software\rpa\macros\folder1\folder2\macro name1.json”)

But actually… looking at your code again I think in your case it might be a simple typo:

=> Instead of repertoire%%fichier try repertoire%20fichier (In URLs %20 is used to replace space " ").

(*)PS: We use this “within home folder only” limitation because otherwise it can get quite tricky with the relative paths to CSV files, subroutine macros and images. But in the future we plan to support absolute paths.

1 Like

Thanks for your answers,

I have tried this and it works fine without specifying the directory :

set fichier1=LoginBasicUser
set htmlFile=file:///C:\Users\MYUSER\Desktop\git\ui-vision-test-automation-2\myProject\ui.vision.html
“C:\Program Files (x86)\Google\Chrome\Application\chrome.exe” “%htmlFile%?storage=xfile&macro=%fichier1%&direct=1&savelog=log1.txt”

But no need to use %20 in my case because there is no spaces into file names.

Thanks a lot for your precious help