# Profile

## Purpose

* We can specify **single property file** profile using the Profile feature
* This is useful if we want to specify different environment&#x20;

## Implementation

* In automation -> resource directory, we create a directory pertaining to our profile. eg. environment
* We then add the different profile property files, each containing info about the different environments to test on
  * eg. dev.property, qa.property...

![](https://3031668975-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LZhvc5eykluSdIwbEC_%2F-M5sS_qhY94bUW_xq5DS%2F-M5sUBzggofe2pmGNgjz%2Fimage.png?alt=media\&token=0f036301-5283-46bd-b5cf-327f4f90d952)

## Define profile

* We then specify the profile in the **properties.property** file
* ```
  # single config files. prefix: 'config.profile.'. select profile from inside the path
  config.profile.environment = "./resources/properties/environment/"    
  ```
  * We prefix the profile with "config.profile" and then the profile name
  * Additional profiles can be added using same syntax
    * eg:
    * ```
      config.profile.suite = "./resources/properties/suite/"    
      ```
      * Here, we create new profile called "suite"

## Specify Profile

* We can the specify the desired profile in Properties.property file
* ```
  # environment
  profile.environment = dev
  ```
  * Syntax: profile.profileName = profile
  * **environment**: the profile name we specified
    * ```
      config.profile.environment = "./resources/properties/environment/"        
      ```
  * **dev**: The property file containing the profile info. In this case: **dev.property**
