Friday, February 25, 2011

Start selenium server through IntelliJ IDEA

Include following libraries :


import org.openqa.selenium.server.RemoteControlConfiguration;
import org.openqa.selenium.server.SeleniumServer;

Public class SetuptearDown extends SeleneseTestCase{

    Selenium selenium;
    public static final String MAX_WAIT = "60000";
    private SeleniumServer seleniumServer;
     private String testURL = "www.testURL.com/";             // Change URL here..............................
    private String testplatform = "*firefox";                               // change platform here................



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

        rc.setReuseBrowserSessions(true);

        seleniumServer =  new SeleniumServer(rc);

        selenium = new DefaultSelenium("localhost", 4444, testplatform, testURL);
        seleniumServer.start();
        selenium.start();
    }


    @AfterClass
    public void tearDown() throws Exception {
        selenium.stop();
        seleniumServer.stop();
    }
    public void login(String username,String password)
    {
       

    }
}

No comments:

Post a Comment