Pages

Search This Blog

Monday, May 17, 2010

Start selenium server through eclipse

You can start selenium RC server using JAVA code in eclipse.

import com.thoughtworks.selenium.*;
import org.openqa.selenium.server.SeleniumServer;
import org.openqa.selenium.server.RemoteControlConfiguration;


public class Cartpayment extends SeleneseTestCase {

Selenium selenium;
public static final String MAX_WAIT_TIME_IN_MS="60000";
private SeleniumServer seleniumServer;




public void setUp() throws Exception {
RemoteControlConfiguration rc = new RemoteControlConfiguration();
rc.setAvoidProxy(true);
rc.setSingleWindow(true);
rc.setReuseBrowserSessions(true);

seleniumServer = new SeleniumServer(rc);
selenium = new DefaultSelenium(localhost, 4444, *firefox, "http://www.yahoo.com");
seleniumServer.start();
selenium.start();
}


6 comments:

  1. Hi Niraj i have tried this but in which jar file
    import org.openqa.selenium.server.SeleniumServer;
    import,org.openqa.selenium.server.RemoteControlConfiguration;

    these classes are found ?

    ReplyDelete
  2. Hey great blog!

    I'm using Selenium/JUnit and Java for tests and I was wondering if you knew a way to dynamically start a selenium server ---

    for instance, if I'm running a suite of tests on regular selenium server port 4444, what could I use to listen in and tell me if activity is still ongoing on that port, then if so, create another selenium server on port 4445?

    thanks for any advice. danvideo1{a-t}gmail.com

    ReplyDelete
  3. Thanks for sharing great information in your blog. Got to learn new things from your Blog . It was very nice blog to learn about Selenium

    ReplyDelete
  4. Thanks for sharing great information in your blog. Got to learn new things from your Blog . It was very nice blog to learn about Selenium.
    Selenium

    ReplyDelete
  5. It was very nice blog to learn about Selenium.Thanks for sharing new things.selenium training in chennai

    ReplyDelete