I’m completely new to Selenium, and I’m using version 2.0rc2. I’ve seen a lot of resources showing how to start the server programmatically through Java, but what has me confused is that the two JARs for Selenium 2.0rc2 do not have the package org.openqa.selenium.server.SeleniumServer I need to import in order to do this.
Has this been deprecated in place of something different in 2.0? If so, how do I start the server from Java? If not, why is that import not there?
It depends what it is you want to do. The easiest way for you to get set up is to download the standalone-jar and add it to your buildpath. This will add the selenium stuff as well as all its dependencies.
Now you can actually already start off very very simply. This is a very decent place to get started but the examples there are using older APIs. Actions should now be done with advanced user interactions.
To understand what SeleniumServer is for you must understand there are two ways to use Selenium. You can either use the ‘client’ which are language bindings which deal with browser launching, etc. An example of this is:
This should launch an instance of internet explorer, go to google and immediately exit. The ‘server’ side of the code is where you can launch an instance of a server on a machine and have your code connect to it. This can be done programmatically but also more easily via the command line. The JAR you downloaded can be invoked with ‘java -jar’ as well as providing the Selenium API. For example if you went to a command prompt and did:
Assuming you gave valid arguments it would kick off a server instance which waits for code to connect to it. I’m actually not 100% sure whether this is for SeleniumRC (1.0 API) or WebDriver (2.0 API).
To answer your question directly I just downloaded the standalone which does contain SeleniumServer.