Archive for June, 2011

SetUp method for Selenium RC.

June 29, 2011 1 comment

We can write setup method for Selenium RC in different ways.

1. Initialize the selenium server for test classes after starting the selenium server manually.

2. Initialize and Start selenium server from the code itself.

If we use TestNG framework we can write this setup method as BeforeClass.

Sample code for first method

    public void testsetUp() throws Exception
        selenium = new DefaultSelenium(“localhost”, 4444, “*firefox”, BaseUrl);

Sample code for second method


public void SetUp(String url, String browser) throws Exception
         SeleniumServer seleniumserver = new SeleniumServer();
        setUp(url, browser);“/”);

%d bloggers like this: