Trying to convert our current .iim macros to UIVision but can’t find a suitable command for iMacros ONCERTIFICATEDIALOG
We have a website that prompts to select a certificate before we can log in, or the login page even loads.
It’s the first time I see this command, with ui vision you can use Xclick and image recognition to select the element you prefer. With desktop automation you can automate anything web and non-web
This is the correct answer
UI.Vision as no built-in ONCERTIFICATEDIALOG command, but you can fully automate the certificate dialog by switching to desktop automation for this part of the macro and then use XCLICK and XTYPE. If needed, you can even read the text on the dialog with the integrated local OCR.
Example of such an dialog (for other readers of this post):
Thanks for that
To expand on our project a bit more, we also received the “End of Support” email (if you will) from Progress and are looking to replace it.
Evaluating is kind of difficult as we use it for credential management.
A VBS script pulls current username/password from the application, feeds that to the iMacros macro to log into the web GUI:
VBS dictionary
varDictionary.Add “username”, WScript.Arguments.Named(“username”)
varDictionary.Add “pmpass”, CurrentPassword
We need to feed these into iMacros
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=NAME:Email CONTENT={{username}}
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:NoFormName ATTR=NAME:Password CONTENT={{pmpass}}
Is this something that is possible? I think it is, but can’t figure out the parameter conversion from iMacros to RPA
Hi
I have been using ui vision for about 4 years and I can confirm that it can perform all Imacros jobs and many others.
I had to study a lot (thousands of hours of study in the ui vision forum and documentation) but today I can confirm that Ui vision can automate anything, you got it right, anything, sites and even desktops.
Ui vision is more difficult to use than Imacros but once you learn it you can automate everything.
I thank the Ui vision staff for always updating and improving it over time.
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=NAME:Email CONTENT={{username}}
Converting this to Ui.Vision is easy, the only challenge is that the locators in UIV are different. iMacros uses its own special format ("TYPE=INPUT:TEXT FORM=NAME:NoFormName ") whereas UiV uses Selenium IDE-style standard Xpath and CSS locators.
=>
-
I recommend that you re-record the click on the text box, then UiV creates the locator for you (just like iMacros did).
-
Variables work the same in iMacros and UiV, just the format is slightly different. iMacros uses
{{username}}
and in UiV it will be${username}
In the end, the new line in UiV will look something like this:
TYPE | id=user | ${username}
or maybe
TYPE | xpath=//div[5]/input| ${username}
(locator here is made up, since I dont know your website)
PS: For more hints, have a look at this imacros migration page.
Thanks Plankton, I was able to find the element, just couldn’t get the variable right.
Only issue is feeding the variable. Log file states:
Executing: | type | id=user | ${username} | 2023-02-02T18:11:42.467Z - [error] variable “USERNAME” is not defined
Username is set in the varDictionary
varDictionary.Add “username”, WScript.Arguments.Named(“username”)
Do I need to put the varDictionary inside the PlayAndWait function?
Yes.
So with the iMacros scripting interface, in VBS, you used:
varDictionary.Add “username”, WScript.Arguments.Named(“username”)
Ui.Vision supports something similar, but has the fixed ${!cmd_var1} (or _var2 or _var3 values).
So inside your RPA VBS script, add &cmd_var1 + username to the command line (line 115 in this screenshot):
And in the macro, use then ${!cmd_var1} as user name (note that here there is a ! in the variable name, as all internal vars have):
type | id=user | ${!cmd_var1}
Tried your suggestion above and still not getting the parameters to load when the script runs.
Username field is either blank or “Not Set” depending on how I write line 115 above
Currently I have it set this way:
Dim varDictionary
Set varDictionary = CreateObject(“Scripting.Dictionary”)
'usernames and address
varDictionary.Add “username”, “Fred”
keys = varDictionary.Keys
For i=0 To varDictionary.Count - 1
key = keys(i)
value = varDictionary(key)
MsgBox (“
Key " & keys(i) & “=” & varDictionary.Item(keys(i)))
result = ObjiMacros.Set(key, value)
ErrorHandler result, String.Format(“Failed to initialize variable [{0}]”, key), ObjiMacros
Next
arg1 = Chr(34) & path_autorun_html & “?storage=xfile¯o=” & “Macro.json” &”&direct=1&savelog=“”&cmd_var1=" & username &“&cmd_var2=” & password & Chr(34)
this gives me a blank username field
If I use this - savelog=“”&cmd_var1" & “&cmd_var2=” - The username field returns “Not Set”
I need to get the value from the varDictionary.add “username”, “Fred” to be input into the username field.
I’ve already tried straight username=“Fred” and that works, but “Fred” will change with every account that runs the application. That’s the variable I need to get from varDictionary
When I migrated from Imacros to Ui vision I initially tried to replicate the same Imacros commands with ui vision having many problems because Imacros is different from Ui vision.
After studying ui vision well I realized that Ui vision has many and different commands and I rewrote again my automations based on Ui vision commands which are numerous and different from Imacros.
In my opinion you should use a csv with all the data saved in this way you can extrapolate them and use them in your Ui vision automations.
Adapt your script to create a csv with all the data, after that it will be very easy to extract them with ui vision macros.
Imacros and ui vision are different as automation systems
[quote=“rlbck38, post:9, topic:11609, full:true”]
Tried your suggestion above and still not getting the parameters to load when the script runs.
Username field is either blank or “Not Set” depending on how I write line 115 above
Currently I have it set this way:
Dim varDictionary
Set varDictionary = CreateObject(“Scripting.Dictionary”)
'usernames and address
varDictionary.Add “username”, “Fred”
keys = varDictionary.Keys
For i=0 To varDictionary.Count - 1
key = keys(i)
value = varDictionary(key)
MsgBox (“
Key " & keys(i) & “=” & varDictionary.Item(keys(i)))
result = ObjiMacros.Set(key, value)
ErrorHandler result, String.Format(“Failed to initialize variable [{0}]”, key), ObjiMacros
Next
arg1 = Chr(34) & path_autorun_html & “?storage=xfile¯o=” & “Macro.json” &”&direct=1&savelog=“”&cmd_var1=" & username &“&cmd_var2=” & password & Chr(34)
this gives me a blank username field
If I use this - savelog=“”&cmd_var1" & “&cmd_var2=” - The username field returns “Not Set”
I need to get the value from the varDictionary.add “username”, “Fred” to be input into the username field.
I’ve already tried straight username=“Fred” and that works, but “Fred” will change with every account that runs the application. That’s the variable I need to get from varDictionary
What variable name do you use in your macros? It should be ${!cmd_var1} (Note the ! - the ! is not in the command line, only in the macro )
{
“Command”: “type”,
“Target”: “NAME=USER_ID.WEB_USERSUSP.REFERENCEXM.1”,
“Value”: “${!cmd_var1}”,
“Description”: “”
},
“Value”: “${!cmd_var1}”,
Looks ok
As a test, does &cmd_var1=ABC
work?
Managed to get almost everything working
VBS starts the json and feeds the correct variables to login.
Last thing to figure out is error checking
iMacros does this:
ExtractedData = ObjiMacros.iimGetLastExtract()
Wscript.StdOut.Write ExtractedData
How is that translated (if you will) to RPA?
in the json I have:
{
“Command”: “sourceExtract”,
“Target”: “regex=(Invalid user id or password|Error on field USER|Invalid|locked)”,
“Value”: “FailedText”,
“Description”: “”
},
{ “Command”: “echo”,
“Target”: “ExtractedData = ${FailedText}”
},
Log files show ExtractedDate = locked
So it’s getting the correct value for now
Just can’t get the VBS to read the $(FailedText) variable
Ui.Vision does not a have direct equivalent of iimGetLastExtract
. The iMacros Scripting interface provides iimGetLastExtract to get the web scraping result back back into the calling script.
So how to return the extracted data back with Ui.Vision?
I recommend to save the data to a CSV file and then read the CSV file in your script.
For that, the RPA software has the commands: