Saturday, 27 April 2013


Eclipse configuration for Selenium RC


Steps:
1. Create  your java project in eclipse
    -> Launch Eclipse
                -> Creat a java project named TestProject (for example)
2. Add Junit Library to your project
  ->  Go to Project Properties(Right Click on Project and click on Properties)
  ->  Go to Java Build Path
  ->  Click on Libraries tab
  ->  Click on 'Add Library' button
  ->  Select 'Junit' option from list and click on next
  ->  Select version 'Junit4' from drop down and click on finish.
3. Add required  Jar files into Project:
                ->  Go to Project Properties
                 ->  Go to Java Build Path
                 ->  Click on Libraries tab
                ->  Click on 'Add External Jars'  button
                ->  Browse for “selenium-java-client-driver.jar” and “selenium-server.jar”
4. Add your test (Java class )  in our Project
                ->  In eclipse go to create a new java class
->  Create it with name MyFirstTestCase (for example) and paste the code from file( record the application and convert to junit4 from selenium IDE)
                ->  Choose "com.thoughtworks.selenium.SeleneseTestCase" as its super class
 ->  Finish it
5. Add Steps to start selenium server
Write below line at the start of setUp() method.
SeleniumServer sServer = new SeleniumServer();
sServer.start();

Note :- write below line at the start of this test( next to package, if package exist)
            import org.openqa.selenium.server.SeleniumServer;
6. Change the browser name in  DefaultSelenium() method
            exp:- write *iexplore for internet explorer

7.Run the test
     
      Right click on project and choose run as junit

No comments:

Post a Comment

Angular JS Protractor Installation process - Tutorial Part 1

                     Protractor, formally known as E2E testing framework, is an open source functional automation framework designed spe...