# Executing Test Studio Tests with Bamboo

<a href="http://www.telerik.com/teststudio" target="_blank">Test Studio</a> test project can be integrated in continuous integration environment using Bamboo server.

**Using the ArtOfTest.Runner.exe**

In order to use ArtOfTestRunner.exe for executing your tests you will need to define new plan.

1. Create new plan

   ![Create new plan](https://www.telerik.com/teststudio/documentation/assets/8f5076309ebdd89ef979f957a62664ca/create_plan.png)

2. Configure the plan

   ![Configure the plan](https://www.telerik.com/teststudio/documentation/assets/ae0418a9ee2feaf49b60af4c47960d4f/configure_plan.png)

3. Add tasks

* 3.1. Add new command task:

  ![Add new command task](https://www.telerik.com/teststudio/documentation/assets/bfceedb44e49e82520945ea09d9c1ebf/new_command_task.png)

First step is to add new executable, it's path should be path to the Test Studio runner (ArtOfTest.Runner.exe). **Default location of ArtOfTest.Runner.exe is "C:\Program Files (x86)\Progress\Test Studio\Bin".**

![Add new executable](https://www.telerik.com/teststudio/documentation/assets/cc53e0327f2cb689609fe247a346bea9/add_new_executable-teststudio.png)

To configure the task add following arguments:

```
list="PATH_TO_PROJECT\TEST_LIST_NAME.aiilist" out=${bamboo.build.working.directory} junitstep
```

<strong>OR</strong>

```
test="PATH_TO_PROJECT\TEST_NAME.tstest" out=$bamboo.build.working.directory} junitstep
```

![Command task](https://www.telerik.com/teststudio/documentation/assets/070ddf99e38f45d71003bfcb27254520/runner_command_task.png)

* 3.2 Add new script task - Convert to NO-BOM task

> Note: This task should be "Final task"

![New script task](https://www.telerik.com/teststudio/documentation/assets/591dfb82a9ff48123095ad156e5aca7f/new_script_task.png)

> This step is needed, because Bamboo JUnit parser can't parse files encoded in UTF-8-BOM. <br>
> <br>
> Reference on the topic can be found <a href="https://confluence.atlassian.com/bamkb/junit-parser-failing-to-find-or-parse-test-results-935372076.html" target="_blank">here</a>.

Source of the script:

```
Write-Output $env:WORKDIR;

Get-ChildItem $env:WORKDIR -Filter *.xml | 
Foreach-Object {
    $MyFile = Get-Content $_.FullName
    Write-Output $_.FullName;
    $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding($False)
    [System.IO.File]::WriteAllLines($_.FullName, $MyFile, $Utf8NoBomEncoding)
}
```

Save the script in desired location.
Add following Environment variable to the task:

```
WORKDIR=${bamboo.build.working.directory}
```

![Script config](https://www.telerik.com/teststudio/documentation/assets/d13487966bc0d248ea87e393dd3a16ba/script_config.png)

* 3.3 Add new JUnit parser task

> Note: "This task should be Final task"

![JUnit parser task](https://www.telerik.com/teststudio/documentation/assets/c60da0e6ceaac568f3510b66d575be44/new_junit_parser_task.png)

Specify custom results directories to be \*\*/\*.xml

![JUnit config](https://www.telerik.com/teststudio/documentation/assets/6b3f157b1ac1e381709c5294d2c9e2f5/junit_config.png)
