Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Open the macro creation window


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
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}

do

...

repeat if

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

executeScript 



repeatif


return document.body.innerHTML.search("At this time there are no appointment slots available");


${textLocation} != -1


textLocation






Examples


Code Block
languagejs
{
  "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": ""
    }
  ]
}


References

ReferenceURL
Home Pagehttps://ui.vision/rpa

...