Local variables

BugBug has the option to set up and insert a variable from the tested source during test recording. Now you can store any text value from the web page you are testing in a variable and use it in feature steps. For example, to find out newly registered unique users in your CRM. Also, you can use built-in variables or custom variables added to the project.
A new option for variables in the test recording process can be found in the BugBug Extension overlay.
When you click on the "Variables" button there will be two new options.

Save variable for later

This option is used to save the new text value as a variable during the test recording. You can find an element and copy the value directly from the browser. Now there is no need to hardcode values and change them later in a BugBug web app steps edition. You can move forward.
Click on the "save variable for later" button. Saving a variable mode is now active.
Click on a "save variable for later" button
At this time you can click on an element with text value on a tested web app and save it into a variable. For example, you can save Jira ticket number.
Click the item with the desired text value
When an element is selected and a value is recorded, you will see an input in the BugBug extension menu where you can save the name for the new variable. Later this name will be visible in a list of variables in the BugBug extension menu.
No spaces or other special characters allowed
When you save a variable, you will be taken to the main menu of the BugBug extension and can continue recording steps.
The saved variable is a cross-domain feature. Now you can use the saved value on different web apps in one test. eg. you can open a new tab and use stored value there.
The variable can be overwritten several times during the test recording by using the same name. If you want to avoid this situation, use some unique names each time.
Using the same name of the variable as the built-in or custom variable name will override the data. This can cause a problem if your test is based on them and overriding these variables is not intended.

Insert a variable during step recording.

Now you can insert a variable during step recording in BugBug. You can use saved variables from previous steps, use custom variables from the project, or use global variables that are predefined by default.
Click the "Insert Variable" button. A variable menu will open. As you can see, we suggest the last saved variable by default. Every variable has a name and length-limited value presented below the name. You can open the drop-down menu to select another variable from the list. Available variables will be discussed in another chapter. Now we will focus on how to insert our saved variable into the designated input.
Insert mode for selected variable is now active.
When you open the "insert variable" menu the insert variable mode is now "On" for the selected variable. Now let's move on to the web application we're testing.
find an input you want to fill with the variable
If you have an input that you want to automatically fill and you have opened the Insert Variable menu with the selected variable, you can simply click on an input to fill it with a value.
The "Insert variable" menu closes. The entry is saved with the value, and you can continue recording steps such as clicking Enter to open search results.

Available variables.

During recording, you can also insert a variable added by default from BugBug such as:
  • Built-in variables
  • Custom variables
All these variables are described in the Variables section of BugBug documentation.
Variables added by default to insert list.
Using built-in or custom variables is now easy and you do not need to edit steps in the BugBug web application UI. You can find them in the list.

Unavailable variables during step recording.

Built-in variables based on a suit or scheduled run

We cannot provide data such as {{suiteRunId}} because when recording, there is no suiteRunId. It's only accessible when the suite is running. You can insert this variable in normal test-edit mode on the BugBug web app UI for a case.
Some of the built-in variables are now disabled with notification. BugBug cannot import data from these variables. You can use it in step edit on BugBug web app UI.

Custom JS variables

Currently, there is no way to use a custom js variable during test recording. We are working on providing such a feature, but for now, we can only use variables with values that are accessible before the test starts recording. You can use custom JS variables in step edit on BugBug web app as we suggest in our documentation.

Search variables on the list

You can search for variables on BugBug extension list by the variable name.

Local variables in web app UI

There is a new step form for local variables recorded from the tested source. You can edit this variable freely. The recorded variable can be found in the step list as a "set variable".
Recorded step for local variable
You can edit values such as the variable name or the correct item selector in the BugBug web application UI after you have finished recording.
Use a local variable
You can use local variables by selecting the "Insert variable" option during recording in the BugBug overlay. At the end of the recording session, the step using the local variable will be saved as "Type text" with the variable name used in the "value" field.
You can also add a local variable from BugBug web app UI by selecting "add a new step" on the list and fill all manually.
Select "Set variable" from the modal.
And fill in the requested inputs
Any recorded local variable can be used in the following steps by mentioning the local variable name in double curly brackets e.g. {{savedVariable}} in any text field like an assertion or custom selector. For more info check out what are variables.