Integrating Protractor to Octopus deployment (CI/CD Integration)

  • I have a batch file with below content:

    %1 %2 --params.validFile=%3 --params.invalidFile=%4
    <p>I am starting it through power shell script:</p>
    <pre class="lang-ps prettyprint-override"><code>    $path= "<filePath>\start.bat"
        $args= '"<filePath>\protractor" "<filepath>/conf.js" "<filepath>/invalidfile" "<filepath>/validfile"'
        Write-Host "Executing: " $path $args
        $process = Start-Process $path $args -RedirectStandardOutput stdout.txt" -RedirectStandardError "stderr.txt" -PassThru
        if ($process.ExitCode -eq 0){
          Write-Host "protractor cmdline complete"
          Exit 0
        } else {
          Write-Error "protractor cmdline failed"
          Exit 1


    • filepath is the absolute path
    • invalid and valid files are just parameters to the test


    On running this as part of octopus deployment, the logs shows the "protractor cmdline failed" printed, but the octopus step never ends. It keeps on going forever.

    Could someone help in knowing how to integrate protractor with octopus?

  • The issue was because the chromedriver was not exiting after test execution completes. This makes the octopus script to hang


    So the work around was to add directconnect to the conf.js

    exports.config = {
      directConnect: true,

    Also i fixed the powershell script as:

    $process = Start-Process -FilePath "$ProtractorPath" -ArgumentList $args -PassThru


    $ProtractorPath= "<path>/protractor"
    $args= '"<path>/conf.js" --params.value="bla"'

    So now i am not executing protractor using batch file , but directly from powershell.

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2