title: Configuring a Jenkins build using Selenium with Browserstack
body: <p>Has anyone out in the community successfully created a Selenium build in Jenkins using Browserstack as their cloud provider, while requiring a local testing connection behind a firewall?</p>
  
  <p>I can say for sure Saucelabs is surprisingly easy to execute builds with the Sauce Jenkins plugin in a continuous deployment environment as I have done it. I cannot however, say the same for Browserstack. The organization I work with currently uses Browserstack, and although their service does support automated testing using a binary application I find it troublesome with Jenkins. I need to make absolutely sure Browserstack is not a viable solution, if so. I love Saucelabs and what their organization provides, but if Browserstack works I don't want to switch if I don't need to.</p>
  
  <p>The Browserstack documentation instructs you to run a command, with some available options, in order to create a local connection before execution.</p>
  
  <pre><code>nohup ./[binary file] -localIdentifier [id] [auth key] localhost,3000,0 &amp;
  </code></pre>
  
  <p>I have added the above statement as a pre-build step shell command. I have to also add 'nohup' as once the binary creates a successful connection, the build never actually starts since I have not exited as displayed in the output below.</p>
  
  <blockquote>
    <p>BrowserStackLocal v3.5</p>
    
    <p>You can now access your local server(s) in our remote browser.</p>
    
    <p>Press Ctrl-C to exit</p>
  </blockquote>
  
  <p>Normally I can successfully execute the first build without a problem. Subsequent build configurations using the same command never connect. The above message displays, but during test execution Browserstack reports no local testing connection was established. This confuses me.</p>
  
  <p>To give you a better idea of what's being executed, I have 15 build configurations for various projects suites and browser combinations. Two Jenkins executors exist and I have more than 5 Browserstack VM's available at any given time. Five of the builds will automatically begin execution when the associated project code is pushed to the staging server, filling up both executors. One of them will begins and end fine. None of the others will as Browserstack reports local testing is not available.</p>
  
  <p>Saucelabs obviously has this figured out with their plugin, which is great. If Browserstack requires shell commands to create local testing connections, I must be doing something wrong, out of order, etc.</p>
  
  <p>Environment:</p>
  
  <ul>
  <li>Java 7</li>
  <li>Selenium 2.45</li>
  <li>JUnit 4.11</li>
  <li>Maven 3.1.1</li>
  <li>Allure 1.4.10</li>
  <li>Jenkins 1.5</li>
  </ul>
  
  <p>Can someone post some information who use Browserstack in a continuous testing environment while utilizing multiple parallel test executions and tell me how each build is configured?</p>
  
  <p>Thanks,</p>