# Smarty

## What is Smarty?

**Smarty** is a predefined words or functions that are used in the **Action class**. For example while testing, If you have to read OTP of an email for 'n' number of times, Instead of writing down the code each and every time you can use the predefined word such as "**email:Reads OTP**", where the action that needs to be taken is already written in the library files.

#### Predefined Smarties

[File: Reads File Data](https://docs.qatts.com/automation/objects/smarty/file-reads-file-data)

Email: Read OTP

EmailRead

EmailSend

Capcha

Site Scan

Excel: Read Data from Excel File

Msg Publish: Push  message to Published Topic

## Step by step walkthrough

To add Smarty follow the below steps.

**STEP 1**:  Click on **Studio** on the Left Navigation Panel, it directs to new window which will be appearing as shown below.

![A new window is opened after clicking on the Studio](https://1916024011-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVX-yOtIHRnx7UtstUT%2F-Mgp4eu5xaGEWm-XurSa%2F-MgpSeICOkIC4wEvjWBv%2FSuit.JPG?alt=media\&token=de11e8f8-6ae1-43a6-93ac-31f5c86949e8)

**STEP 2**: On the right corner Click on "**+**" icon and select **Add Smarty**, it should appear as below.

![](https://1916024011-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVX-yOtIHRnx7UtstUT%2F-MhIDza1tpBDsXRV4geC%2F-MhIFueLjdvmKsgU1rWE%2FAdd%20Smarty.png?alt=media\&token=ffa29b76-b552-479e-9f9f-349b3cf2e280)

**STEP 3**: Fill the required details as shown in the below screenshot.

![](https://1916024011-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVX-yOtIHRnx7UtstUT%2F-MhIDza1tpBDsXRV4geC%2F-MhIG0d-Q6Jf0D17zJWL%2FAdd%20Smarty1.JPG?alt=media\&token=cfd6625e-d29f-403f-93c5-37847e35c092)

* **Smarty Name:** Name could be any of the user choic&#x65;**.**
* **Description:** Describe the function of the smarty.
* **Smarty Type:** Specify the type of smarty you want to add from the drop down box.

**STEP 4**: After adding the required details click on **Save** and the data will be added in the Group you have Selected.

## Short Video

![](https://1916024011-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MVX-yOtIHRnx7UtstUT%2F-MkkScD3L-NFtcJePitg%2F-MkkaM3umZurZldIHsBj%2FAdding%20Smarty.gif?alt=media\&token=1a351ddf-2e70-4494-884b-ab237100884b)
