# Cucumber + Selenium: Programmatically Starting a Test Server

**URL:** <https://www.ruby-forum.com/t/cucumber-selenium-programmatically-starting-a-test-server/167907>\
**Category:** Rails\
**Created:** [May 13, 2009, 9:45pm UTC](https://www.ruby-forum.com/t/cucumber-selenium-programmatically-starting-a-test-server/167907 "2009-05-13T21:45:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aaron\_Carlton](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b9e5f3/32.png) [@Aaron\_Carlton](https://www.ruby-forum.com/u/Aaron_Carlton)\
**Post date:** [May 13, 2009, 9:45pm UTC](https://www.ruby-forum.com/t/cucumber-selenium-programmatically-starting-a-test-server/167907/1 "2009-05-13T21:45:52Z")

</div>

Hi All,

I am trying to learn BDD using the Cucumber framework, and am  
integrating Selenium for client side tests. I’ve been playing with  
refactoring my cucumber installation a bit, and have pulled the code  
to start the selenium server out into a profile-configuration file,  
similar to env.rb:

# start selenium

server  
@@browser = Selenium::SeleniumDriver.new(“localhost”, 4444, “\*chrome”,  
“[http://localhost](http://localhost)”, 15000)  
@@browser.start

# teardown - stop selenium

server  
at\_exit do  
@@browser.stop  
end

I would like to do the same thing to start my rails application test  
server that I can run browser tests against, but I’ve googled and  
haven’t been able to find a clearcut suggestion. Does anyone know how  
to start/stop a rails server in :test mode via ruby? Will I have to  
resort to system() calls? Your help and time is appreciated!

Aaron
