Overview

The UI Vision RPA software is the tool for visual process automation, codeless UI test automation, web scraping and screen scraping. Automate tasks on Windows, Mac and Linux. UI Vision RPA is just like Selenium IDE but better.

Installation

This application is a browser plugin.


See product home page for additional details: https://ui.vision/rpa


You will also want to install the extension modules. Install the extension modules: 

https://ui.vision/rpa/x/download

Getting Started

Open the macro creation window


Set Permissions

  


Click on Extensions in the top right hand corner and then click on the three dots and select manage extension.

Enable Site Access = On all sites

Alllow in Incognito

Allow access to file URLs

Recording a Script

To get started, we can record a wen session and then modify it as needed.

To start a recording, click the +Macro in the top left hand corner.

Give you macro a name and then click Confirm.

Click the Record button to start recording a web session.

When you are done, return to the UI Vision screen and click Stop Recording.


Commands

CommandDescriptionExample
CommandTargetValue
storeThe Selenium functions store, storeValue, and storeText store some data for later access. Selenium uses a map called storedVars to store the data. You can use previously stored variables. ${varaiable_name} gives us access to the storedVars map. To display the value of a stored variable use "echo".storeJohnfirstName
storeWe can store the runtime in a variable to get performance values. How long it took to get to this point in the script.store${!RUNTIME}endTime
commentAdds a commentcommentMy comment here
openThe "Open" command opens the URL in the current selected browser tab. The open command takes a full URL as input (recommended) or a path relative to the baseurl (outdated).openhttp://www.google.com/
typeTYPE sets the value of an input field, as though you typed it in. typeid=sq_101i${firstName}
click

clickAndWait and click send a Javascript click event to the DOM element defined by the locator.

The difference between clickAndWait and click is that clickAndWait waits for a page load event after the click. So clickAndWait = click + waitForPageToLoad.

clickxpath=//div[2]/div/div/a
select

The purpose of select and selectAndWait is to select a value from drop down/combo box or list box.

selectxpath=//*[@id="sq_102"]/div[2]/div[2]/div/div[2]/selectlabel=${birthMonth}
executeScript

The executeScript command executes a snippet of JavaScript in the context of the currently selected frame or window. The script fragment will be executed as the body of an anonymous function. To store the return value, use the 'return' keyword and provide a variable name in the value input field.

executeScriptreturn Number (${i}) + 1;i
Play an audio file.executeScriptvar audio = new Audio("https://www.myinstants.com/media/sounds/jeopardy.mp3"); audio.play();
executeScript_SandboxThe executeScript_Sandbox works exactly as executeScript but runs the Javascript in a sandbox. In other words, the code runs not in the website. The advantage of using the sandbox is that the website can not influence or block the Javascript execution. So unless you want to access elements of the website, better use the sandbox. The flow control commands (if_v2, while_v2, GotoIf_v2) use executeScript_Sandbox internally to evaluate the expression.executeScript_Sandboxreturn Number (${i}) + 1;i

do

...

repeatIf

The part between Do and Repeat If (expression) is executed as long as the expression is true. RepeatIf uses executeScript_Sandbox to evaluate the expression. If the expression is false, the IDE executes the immediate next command Repeat If.do

executeScriptreturn document.body.innerHTML.search("At this time there are no appointment slots available");textLocation
repeatIf${textLocation} != -1

if_v2

...

elseif

...

else

...

end

if statementif_v2${i} == 0
click ...
elseif${i}==1
click...
else

click...
end

while_v2

...

end


while_v2${i} < 4
executeScript_Sandboxreturn Number (${i}) + 1;i
click...
end

breakThe break statement breaks the loop and continues executing the code after the loop (if any). Usually it is used after a conditional "if" (or similar) statement.while_v2${i} < 4
...

  if_v2${i} == 3
    break

  end

end

Examples

{
  "Name": "walmart-customizable",
  "CreationDate": "2021-5-4",
  "Commands": [
    {
      "Command": "store",
      "Target": "first",
      "Value": "firstName",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "last",
      "Value": "lastName",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "1970",
      "Value": "birthYear",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "Dec",
      "Value": "birthMonth",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "1",
      "Value": "birthDay",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "demo@jmehan.com",
      "Value": "email",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "6135555555",
      "Value": "phone",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "store // k1s2t8",
      "Value": "city",
      "Description": "home"
    },
    {
      "Command": "comment",
      "Target": "store // Kemptville",
      "Value": "city",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "store // renfrew",
      "Value": "city",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "store // kanata",
      "Value": "city",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "ottawa",
      "Value": "city",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "Gloucester",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "store // K1J 9L3",
      "Value": "city",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "Rockland",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "store // K4K 0B5",
      "Value": "city",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "Pembrook",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "store // K8A 8P7",
      "Value": "city",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "Ottawa S",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "store //  K1V1J5",
      "Value": "city",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "store // Brampton",
      "Value": "city",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "store // Vaughan",
      "Value": "city",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "store // 1",
      "Value": "numOfSites",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "4",
      "Value": "numOfSites",
      "Description": ""
    },
    {
      "Command": "open",
      "Target": "https://portal.healthmyself.net/walmarton/forms/Dpd",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "xpath=//*[@id=\"sq_101\"]/div[2]/div[2]/label/input",
      "Value": "false",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"sq_101\"]/div[2]/div[2]/label/input",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "xpath=//*[@id=\"sq_102\"]/div[2]/div[2]/label/input",
      "Value": "false",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"sq_102\"]/div[2]/div[2]/label/span",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"app\"]/div[4]/div[2]/div/div/div[2]/div/div/div/div/form/div[2]/div/div[2]/input[3]",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "clickAndWait",
      "Target": "xpath=//*[@id=\"app\"]/div[4]/div[2]/div/div/div[2]/div/div/div[2]/h2/div/a/strong",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "linkText=First dose of COVID-19 vaccination »",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "id=ajax",
      "Value": "${city}",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"content\"]/div/div[4]/div/div/div/div[2]/div/div/div[3]/div/div/div/div/div/div/div/div/div[2]/div/div/div[3]/ul/li/span/span",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "do",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "0",
      "Value": "i",
      "Description": ""
    },
    {
      "Command": "while_v2",
      "Target": "${i} < ${numOfSites}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "executeScript // return \"start\" + (Number(${i}) + Number(1)) + \"end\"",
      "Value": "test",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "store // ${i++}",
      "Value": "test",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "prompt // ${test}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "First",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "if_v2",
      "Target": "${i} == 0",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"bookingLocationListContainer\"]/div/div/div/div",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "elseif",
      "Target": "${i}==1",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "Second",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"bookingLocationListContainer\"]/div[2]/div/div/div",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "elseif",
      "Target": "${i}==2",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "Third",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"bookingLocationListContainer\"]/div[3]/div/div/div",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "elseif",
      "Target": "${i}==3",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "Fourth",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"bookingLocationListContainer\"]/div[4]/div/div/div/div/div/div/div/div",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "1000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "executeScript",
      "Target": "return document.body.innerHTML.search(\"At this time there are no appointment slots available\");",
      "Value": "NoSlots",
      "Description": ""
    },
    {
      "Command": "if_v2",
      "Target": "${NoSlots}==-1",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "break",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "Click Back",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"content\"]/div/div[4]/div/div/div/div[2]/div/div/div[3]/div/div[2]/div/button",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return Number (${i}) + 1;",
      "Value": "i",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "repeatIf",
      "Target": "${NoSlots}!=-1",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "executeScript",
      "Target": "var audio = new Audio(\"https://www.myinstants.com/media/sounds/jeopardy.mp3\"); audio.play();",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//div[2]/div/div/a",
      "Value": "",
      "Targets": [
        "linkText=Book now:  May 3, 2021 @ 8:00 AM EDT »",
        "xpath=//*[@id=\"content\"]/div/div[4]/div/div/div/div[2]/div/div/div[3]/div/div[2]/div/div/div/div/div/div/div[2]/div[2]/div/div/a",
        "xpath=//div[2]/div/div/a",
        "css=#content > div > div:nth-child(4) > div > div > div > div.panel-body > div:nth-child(1) > div:nth-child(1) > div:nth-child(3) > div > div:nth-child(2) > div > div > div > div > div > div > div:nth-child(2) > div.col-sm-9 > div > div > a.btn.btn-default.wrap"
      ],
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "id=sq_100i",
      "Value": "${firstName}",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "id=sq_101i",
      "Value": "${lastName}",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "xpath=//*[@id=\"sq_102\"]/div[2]/div[2]/div/div/input",
      "Value": "${birthYear}",
      "Description": ""
    },
    {
      "Command": "select",
      "Target": "xpath=//*[@id=\"sq_102\"]/div[2]/div[2]/div/div[2]/select",
      "Value": "label=${birthMonth}",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "xpath=//*[@id=\"sq_102\"]/div[2]/div[2]/div/div[3]/input",
      "Value": "${birthDay}",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "id=sq_103i",
      "Value": "${email}",
      "Description": ""
    },
    {
      "Command": "type",
      "Target": "xpath=//*[@id=\"sq_104\"]/div[2]/div[2]/input",
      "Value": "${phone}",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"sq_106\"]/div[2]/div[2]/label/span",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"sq_107\"]/div[2]/div[2]/label/span",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"content\"]/div/div[4]/div/div/div/div[2]/div/div/div[3]/div/div/div[2]/div[2]/div[2]/div/div/div/form/div[2]/div/div[2]/input[3]",
      "Value": "",
      "Description": ""
    }
  ]
}



Recording Runtime/Performance Metrics

By using the store command with a target of ${!RUNTIME}, we can get some performance metrics.

We need to set a start and end time. From the Variables tab, we can see the runtime values.

Running Multiple Tests in Parallel

Create Multiple Profiles


Click on your current profile in the top right corner of your browser and then click Add.

Click Continue without an account.

Assign the profile a name and click Done.


Using Different Profiles Launch Test

To run multiple tests in parallel from Chrome:

  1. launch Chrome
  2. Select Profile
  3. Install UI Vision and give all access required
  4. Startup UI Vision and run macro
  5. Open a new browser window and change profile and repeat steps 3-4


Launch Tests From Command Line (Advanced)

Generate Autostart HTML Page

From the UI Vision plugin, click on the gear icon in the top right corner and select the API tab on the Settings page.

Click the Generate Autostart HTML Page button. Save or move this file ui.vision.html to a working folder.


Run Command

On Mac:

open -a "Google Chrome" --args --profile-directory="Default" "file:///Users/john/Desktop/ui.vision.html?macro=myMacro&direct=1&close=1&savelog=log1.txt"

open -a "Google Chrome" --args --profile-directory="Profile 1" "file:///Users/john/Desktop/ui.vision.html?macro=myMacro&direct=1&close=1&savelog=log1.txt"

open -a "Google Chrome" --args --profile-directory="Profile 2" "file:///Users/john/Desktop/ui.vision.html?macro=myMacro&direct=1&close=1&savelog=log1.txt"


References

ReferenceURL
Home Pagehttps://ui.vision/rpa
Running multiple tests at the same Timehttps://forum.ui.vision/t/running-multiple-tests-at-the-same-time/379/3