Monday, September 15, 2008

How to use selenium in eclipse

Developing the selenium java along with eclipse makes the work simpler. configuring of selenium in eclipse is much more simpler than other work. I have given you few things regarding selenium eclipse.Test cases can be written in java and it can be executed using eclipse plug-in. Download Selenium Eclipse (Add the downloaded selenium plug in to your eclipse\plugins folder)

To set selenium in eclipse
Eclipse requires JUnit with Ant. The selenium project can also be developed using JUnit with Maven.
Download
Setting up of selenium in eclipse
  • Set system variables
    • JUNIT_HOME=“/*--path of junit jar file c:\selenium\junit-4.4\junit-4.4.jar--*/
  • Set path of system variable for Ant
    • Path=“/*--path of Apache Ant bin c:\Selenium\apache-ant-1.7.1\bin --*/
Procedures for developing selenium project in eclipse
  • Create new Selenium project in Eclipse
  • Then create a new junit testcase in that project. 
  • Add the exported testcase of selenium-ide to the new test case. 
  • Then create a new junit testsuite to run all the testcases. 
  • To run the selenium testcases, start the selenium server (selenium RC) in command prompt. 
  • Then run the test case in junit, which will automatically launch a browser and run the junit scripts in it.

No comments: