Selenium RC in the build

I had to rediscover a bit of lost knowledge last Friday, namely integrating Selenium RC into a set of integration tests. Pretty straight forward really, but I thought I’d better record it for the next time I can’t remember how to start and stop the server from ant.

<project name="Selenium RC Server">
  <target name="start_selenium_rc" description="Start the Selenium RC server"> 
    <java jar="selenium-server.jar" fork="true" failonerror="true"> 
      <arg value="-Port" /> 
      <arg value="4440" /> 
      <arg value="-forcedBrowserMode" /> 
      <arg value="*iehta" /> 
  <target name="stop_selenium_rc" description="Stop the Selenium RC server"> 
    <get taskname="selenium-shutdown" src="http://localhost:4440/selenium-server/driver/?cmd=shutDown" dest="junit_report/result.txt" ignoreerrors="true" />

The forced browser mode is IE for project constraints, but I did have an issue with *iexplore not working due to some proxy error but the experimental “elevated security privilege” browser worked fine.

Not so fine is that the goBack() command does not work in SeleniumRC with “*iehta”.

comments powered by Disqus