Selenium 2 and Junit example
Dec 13, 2011
Description
see www.time2test.co.uk
Selenium 2 and jUnit example
1. use the already created script
2. open up eclipse IDE
3. creat a java project on Eclipse IDE
4. give it a name: Selenium2JavaScript
5. click on Next and Finish
6. create a package for the project
Source folder: Selenium2javaSciprt/src
Name:com.example.tests
7. click on Finish
8. create a java file
New->Class
Name: TestJava
9. Now convert a .html file to .java file
10. open up Selenium IDE and export test case as jUNit4 (webdriver) as .java
11. open up the java file in notepad++
12. copy the saved java file directly into Eclipse
13. Ensure that class name and .java file file name is the same
14. now add the selenium 2 jar and jUnit jar
15 Right click on project->Properties - select java Build Path-> External Jars
16. select jUnit 4.7
17. we have already added the selenium 2 jars to the library so first add selenium 2 jars using "add external jars" button
18. Now Run the Project
19. right click on project->Run As->jUnit Test
20. tick "use configuration specific settings"
21. select jUnit Specific settings
22 . notice the test will execute
23. Green indicates the script run successfully
24. end
Discover more
Keywords & tags
More from this user
selenium 2 with Eclipse and Java
vipingupta
11y ago
Selenium 2 and Junit example
vipingupta
14y ago
Hudson and Selenium Workshop Hosted by time2tes...
vipingupta
14y ago
Selenium 2 and TestNG
vipingupta
14y ago
Selenium 2 Webdriver Example
vipingupta
14y ago
Jenkins Running a Selenium Job
vipingupta
14y ago
Related videos
Selenium 2 Webdriver Example
vipingupta
14y ago
Cucumber and Selenium Problem Example
vipingupta
15y ago
Selenium IDE and Glob Pattern Example
vipingupta
14y ago
Selenium IDE - Regular Expression Example
vipingupta
15y ago
Selenium and Jenkins Job Creation Example
vipingupta
14y ago
Selenium 2.0 , Webdriver used to test Plone
toutpt
16y ago