# Automation Studio API

**URL:** <https://community.br-automation.com/t/automation-studio-api/3777>\
**Category:** B&R Software & Runtime\
**Tags:** automation-studio\
**Created:** [July 15, 2024, 1:16am UTC](https://community.br-automation.com/t/automation-studio-api/3777 "2024-07-15T01:16:56Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![tommi.piiparinen](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/tommi.piiparinen/32/2183_2.png) [@tommi.piiparinen](https://community.br-automation.com/u/tommi.piiparinen)\
**Post date:** [October 31, 2024, 6:34am UTC](https://community.br-automation.com/t/automation-studio-api/3777/5 "2024-10-31T06:34:03Z")

</div>

Hello,

You are correct that an ARSim instance is needed. RUC can spin this up for you.

I have used a separate “UnitTesting” configuration in Automation Studio for this and I first build a RUC package for this unit testing configuration, then i use RUC to start the ARSim instance and then it is possible to run the unit tests with HTTP requests. I used a powershell script to run the tests and parse the results so that I could return either a pass or fail value.

[Automation Help: Using the Unit Test web service](https://help.br-automation.com/#/en/4/technologysolutions%2Fts_unittest%2Fgeneral%2Fts_ut_execute_tests_webservice.html)

Here are some commands, which might be helpful. (I have used these with GitHub actions). Replace the \<\> parts with relevant informations for your project.

1. Create RUC Package for Unit Test configuration, force simulation

```auto
C:\BRAutomation\AS412\bin-en\BR.AS.Build.exe "<PathToProject>/Project.apj" -c <UnitTestConfigName> -buildRUCPackage -simulation

```

1. Create a instruction list(PIL file) for PVITransfer (RUC)

```auto
Write-Output 'CreateARsimStructure "<PathTo>\RUCPackage.zip", "<Path to where you want to create the simulation>", "Start=1"' | Out-File <Path where you want to create the pil file>\CreateUniteTestArsim.pil -Encoding ASCII

```

1. Create and start ArSim

```auto
Start-Process -FilePath 'C:\BRAutomation\PVI\V4.12\PVI\Tools\PVITransfer\PVITransfer.exe' -ArgumentList '-silent -<Path to PIL File here> -<Path to log file>'

```

---

_[View the full topic](https://community.br-automation.com/t/automation-studio-api/3777)._
