# Create a Script

> Write an AutoSteps script and structure the data it reports back to the PerformanceGuard agent.

Source: https://docs.capaone.com/performanceguard/administration/about-autosteps/autosteps-user-interface/create-a-script/  
Product: PerformanceGuard — a separate CapaSystems product; do not apply this page to any other.

# How is the communication between a Script and the PerformanceGuard Agent structured?

<font style="color: #404040;">The structure for the data reported by AutoSteps script must follow the same structure as outlined for the </font>****[Autosteps Chart Widget](/performanceguard/dashboards-and-widgets/widgets/autosteps-chart-widget/)****<font style="color: #404040;">. The documentation on how a script can communicate with the PerformanceGuard agent is described in</font> [Monitor Complex Activity with AutoSteps](/performanceguard/administration/more-setup/monitor-complex-activity-with-autosteps/)<font style="color: #404040;">.</font>

<font style="color: #404040;">You can use the following parameters:</font>

| **Property**          | **Description**                                                                                                                                                                                                                      | **Examples**                                                                                                   |
|:----------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------|
| **Transaction Group** | <font style="color: #404040;">Defines the BTM Transaction Group - Mostly used as an overall category.</font> <br/>⚠️ The length of the characters can not exceed more than 64.                                                       | TransactionGroup = PG Demo Scripts                                                                             |
| **Transaction Name**  | <font style="color: #404040;">Defines the BTM Transaction Name - Mostly used to define a more narrow category like the application or website being tested.</font> <br/>⚠️ The length of the characters can not exceed more than 64. | TransactionName = NOTEPAD Document                                                                             |
| **Tags**              | <font style="color: #404040;">Defines the BTM Tags - Mostly used to describe the exact operation performed by the script.</font> <br/>⚠️ The length of the characters can not exceed more than 64.                                   | - ComPG1.setTag = NOTEPAD startup<br>- ComPG1.setTag = Type in text<br>- ComPG1.setTag = Save NOTEPAD document |

<font style="color: #404040;">To create a new script click</font> ![](/attachments/performanceguard/20d42caa-01bd-4cda-827c-da0670ccefda.png) <font style="color: #404040;">. You can select a category from the menu or you can</font> ![](/attachments/performanceguard/20d42caa-01bd-4cda-827c-da0670ccefda.png) <font style="color: #404040;">create a new **Script Category** while creating a new Script.</font>

**Category:** <font style="color: #404040;">Used to organize your scripts and also makes it easier to search for a particular script.</font>

**Executable and Executable Parameters:** <font style="color: #404040;">Used to define what and how a script is executed.</font>

# Creating Executable and Executable Parameters

<font style="color: #404040;">You can create the line of arguments for the executable and set values to each parameter while creating a new Script.</font>

:::caution
In order to ensure that a file attachment is used please make sure to add the **name of the uploaded file** to the list of Executable Parameters.
:::

<font style="color: #404040;">When AutoSteps executes the script, it is done using the parameters in the order they are written and thus it is important to type the parameters according to the syntax for your executable.</font>

:::caution
Parameters can be defined as variables. A variable can be left as is or overwritten when the script is used to create an AutoSteps Job. You must create and close each parameter variable with a hashtag **#** i.e. **#\<name\>#** otherwise will not be recognized as a variable, e.g. **/c #parameter1# #parameter2#**.
:::

<font style="color: #404040;">After creating a parameter you will be able to add Default Parameter Values to each parameter.</font>

:::note[Important]
**Example:**Click thumbnail to view image in full size.

![](/attachments/performanceguard/767aa336-2a94-4724-b341-1642be532c9c.png) ![](/attachments/performanceguard/0469e280-1e48-4d32-a7ca-bf6805b43f44.png)
:::

:::caution
![](/attachments/performanceguard/7406cfb5-8670-4cb8-8161-7b0ce9828a0f.png) allows you to edit, delete, download these scripts locally on your computer and create a job.
:::

# Creating a Script with an executing binary file

<font style="color: #404040;">AutoSteps supports the use of self-contained executable (.exe files). This allows you to distribute the executable and thus no installation of an executable program on the AutoSteps computer is necessary in order to execute the script.</font>

- Go to Administration > AutoSteps > Scripts and Create a script ![](/attachments/performanceguard/20d42caa-01bd-4cda-827c-da0670ccefda.png)

:::caution
In order to ensure that a self-contained executable will run, make sure to specify the **name of the file** in the '**Executable**' field. If your self-contained executable takes parameters, these are specified as usual in the filed '**Executable Parameters**', e.g. **/c dir c:**.
:::

- Upload the file and Click Save

:::note[Important]
**Example:** Click thumbnail to view image in full size.

![](/attachments/performanceguard/e38a471c-05a8-4697-8f40-8216e6a32207.png)
:::
