Much like every site on the internet, we use cookies to help analyze traffic and improve our website. As outlined in our privacy policy, any information is only used internally and is not shared with outside organizations.
Learn More

Creating Your First Variable

Variables Tool Window

Variables Tool Window

Before We Begin

We don't want to overwrite the file from the previous tutorial. Before making any changes, we need to save a copy of the Process under a new name.

  1. If not already, open Tutorial2.abprocess.
  2. Select File on the Ribbon Command Bar. This will open the Backstage Menu with a list of commands on the left edge.
  3. Select Save As. The Backstage Menu will close and the Save As dialog will be displayed.
  4. Chose a location for your process (e.g. C:\Users\<name>\Documents\AutoBloks) and name your process Tutorial3. Click the Save button to save your file.

You should now have Tutorial3 open.

Overview

The Variables tool window is used to browse and manage Variables. By default, this tool window is docked to the right side of the application window. You may need to use the tabs at the bottom of the dock location to switch between tool windows docked in the same location. You may also use the View tab of the Ribbon Command Bar to activate any tool window.

Ribbon View Element Inspector Steps

Variable Types

There are four types of variables available in AutoBloks. The primary difference between each type relates to how the data for the variable is defined.

System Variables
These read-only variables allow you to access data for the current system and are organized by categories (e.g. current date).
Environment Variables
Read-only variables defined in one or more external files commonly used to store environmental data.
Session Variables
When you run your automation, a session is created to host the execution. Session variables are used to access read-only data related to that session and will only be available when your automation is running (e.g. location of the results directory).
User-Defined Variables
These variables are defined by you for a Process or Scenario and are the only variable types where you can assign values in the tool. These are the variables you will be creating.

Take a moment to browse the Variables tool window to see the available variables. Select any variable and the details of the variable will be displayed at the bottom of the tool window.

Create New User Variable

While Google is unlikely to change their home page, the address of a website does change. In Enterprise environments, the address may shift between Development, QA, and Production environments of the same application. If you want to write a single automated process that could run against more than one of those environments, you could create a variable to store the address. When you need to switch between environments, you simply change the value of the variable. To illustrate, we will create a variable called Url that will store the Google home page address. URL stands for "Uniform Resource Locator" and is how we define the address of pages on the internet.

Create New Variable Steps

  1. Click the New Variable button to create a new variable. This will create a new variable with the default name of NewVariable.
  2. Change the name of the variable to Url.
  3. Set the default value of the variable to the Google home page https://www.google.com.
  4. Optionally set a description. A good variable name is typically enough to describe the purpose, but more complicated scenarios might benefit from a more detailed description.

Variable Name Rules

Variable names must begin with a letter (A-Z or a-z) or underscore character (_), and can then be following by any letter, digit (0-9), or underscore character.

Common Naming Convention

Since spaces are not allowed in variable names, a popular naming convention is to capitalize the first letter in each word so that a change in character casing indicates a change in words. Examples are FirstName and AddressLine1. Acronyms like URL, which are typically all upper-case letters, will still only capitalize the first letter like Url.

Creating the variable is only half of the solution. In the next step, we will cover how to use this variable in your activities. Save your Process before continuing since you added a new variable.