# Run AIQ Scenarios from Jenkins with Ant

 All the ant calls are case-sensitive.

To run scenarios using local files, Jenkins must be installed on a local machine, after which local paths can be specified in place of REPOSITORY paths using SERVER.

1. Save this Jenkins project with these configurations.
2. Click build now.
3. Upon successful build, the user can see the logs by clicking on the build link and then clicking on Console Output which will display all the logs and the link to navigate to Reports of the test run.
    
     ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/dv0a3pVukoG3T52Q-86bb7ba6dbf1.png)
    
     ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/SaFk9QobDmBS5hSd-00155ccb27c2.png)
    
     ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/U7qM5PST6jJ50wBn-bbcea444a0d2.png)
 
Jenkins console or output logs (run from the command line) will show all the details, test case pass / fail, Execution times being taken from all the iterations.

 ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/gC8VBudb9JNODsc0-a77bb672e9b6.png)

Beginning in the AIQ 4.10.0 release, if you want to run multiple scenarios in parallel you no longer have to specify the individual scenarios in the build.xml file. You can now just add the root folder and CICD will run each scenario within that folder.

To pass scenario and folder as a parameter, setup the following:

- In the build.xml file, parameters on top should have the variable reference for the value.
    
    <div class="codeSnippet">[Copy](javascript:void(0);)<div class="codeSnippetBody" data-mc-continue="False" data-mc-line-number-start="1" data-mc-use-line-numbers="False" style="mc-code-lang: XML;">```
    <span style="color: #969896; "><!-- Execute Scenario's parameters --></span><br></br><span style="color: #63a35c; "><property <span style="color: #795da3; ">name</span><span style="color: #df5000; ">="dir"</span> <span style="color: #795da3; ">value</span><span style="color: #df5000; ">="${dirName}"</span> /></span><br></br>        <br></br><span style="color: #969896; "><!-- folder that contains scenario and resources needed by it --></span><br></br>        <br></br><span style="color: #63a35c; "><property <span style="color: #795da3; ">name</span><span style="color: #df5000; ">="scenario"</span> <span style="color: #795da3; ">value</span><span style="color: #df5000; ">="${scenarioName}"</span> /></span><br></br>        <br></br>
    ```
    
     </div> </div>
- Execute Scenario target should have the same variable name defined for the dir and scenario.
    
    <div class="codeSnippet">[Copy](javascript:void(0);)<div class="codeSnippetBody" data-mc-continue="False" data-mc-line-number-start="1" data-mc-use-line-numbers="False" style="mc-code-lang: XML;">```
    <span style="color: #63a35c; "><target <span style="color: #795da3; ">name</span><span style="color: #df5000; ">="executeScenario"</span> <span style="color: #795da3; ">depends</span><span style="color: #df5000; ">="setupEnvironment"</span>></span><br></br>        <br></br><span style="color: #63a35c; "><taskdef <span style="color: #795da3; ">name</span><span style="color: #df5000; ">="executeScenario"</span> <span style="color: #795da3; ">classname</span><span style="color: #df5000; ">="com.appvance.ci.ExecuteScenario"</span>></span><br></br>        <br></br><span style="color: #63a35c; "><classpath <span style="color: #795da3; ">refid</span><span style="color: #df5000; ">="RestClientLibPath"</span> /></span><br></br>        <br></br><span style="color: #63a35c; "></taskdef></span><br></br>        <br></br><span style="color: #63a35c; "><executeScenario <span style="color: #795da3; ">aiqCreds</span><span style="color: #df5000; ">="${credsData}"</span> <span style="color: #795da3; ">dir</span><span style="color: #df5000; ">="${dirName}"</span> <span style="color: #795da3; ">scenario</span><span style="color: #df5000; ">="${scenarioName}"</span> <span style="color: #795da3; ">consoleDetails</span><span style="color: #df5000; ">="${consoleDetailsData}"</span> <span style="color: #795da3; ">resultsFolder</span><span style="color: #df5000; ">="${scenarioResults}"</span> /></span><br></br>        <br></br><br></br><span style="color: #63a35c; "><taskdef <span style="color: #795da3; ">name</span><span style="color: #df5000; ">="fetchScenarioResults"</span> <span style="color: #795da3; ">classname</span><span style="color: #df5000; ">="com.appvance.ci.FetchScenarioResults"</span>></span><br></br>        <br></br><span style="color: #63a35c; "><classpath <span style="color: #795da3; ">refid</span><span style="color: #df5000; ">="RestClientLibPath"</span> /></span><br></br>        <br></br><span style="color: #63a35c; "></taskdef></span><br></br>        <br></br><span style="color: #63a35c; "><fetchScenarioResults <span style="color: #795da3; ">aiqCreds</span><span style="color: #df5000; ">="${credsData}"</span> <span style="color: #795da3; ">consoleDetails</span><span style="color: #df5000; ">="${consoleDetailsData}"</span> <span style="color: #795da3; ">resultsFolder</span><span style="color: #df5000; ">="${scenarioResults}"</span> <span style="color: #795da3; ">scenario</span><span style="color: #df5000; ">="${scenarioName}"</span> <span style="color: #795da3; ">stopOnFailure</span><span style="color: #df5000; ">="${stopOnFailure}"</span> /></span><br></br>        <br></br><span style="color: #63a35c; "></target></span><br></br>
    ```
    
     </div> </div>
- From Jenkins, the parameters for dir and scenario can be passed by using the **Build**&gt; **Advanced** option
    
     ![](https://docs.appvance.net/uploads/images/gallery/2026-07/scaled-1680-/XkqUAtaochg63ELv-0ad5bac915d1.png)
 
<div id="bkmrk-last-updated%3A-march-">---

Last updated: <span class="mc-variable General.NewDateTimeVariable variable">March 01, 2024</span>

If you have any feedback on this topic, please contact us at <documentation@appvance.ai>

</div>