Software Required: Eclipse Juno, Java 32/64 bit depends on your PC configuration, Selenium Java APIs, Selenium Browsers Drivers, Selenium Server Standalone API.
Installation of Eclipse with Selenium Web driver Test NG.
- First Install Java with respect your OS configuration. For 64 Bit OS install 64 bit latest JDK , and for 32 bit OS install latest 32 bit JDK.
- After Installing JDK set “JAVA_HOME” environment variable and set value in “path” variable also.
- Now install latest eclipse Juno with respect OS configuration and Java Configuration.Note: Make sure you create separate “WorkOnTheSelenium” folder in one of the Drive and Extract eclipse there.
- Now create shortcut of eclipse on desktop and open the eclipse , Now while opening eclipse it ask for workspace. So create your workspace in Work folder as “SeleniumWorkspace”.
- Now after giving workspace your eclipse will open. Now you are set with eclipse.
- Now create one java project, File- > New- > Java Project. Give some appropriate name for project , for sample project I am giving “TestProject”. Now your java project is created.
- Now create one package, Right click on project then New- > Package. Here also give some appropriate package name, for sample , I am giving “Testpackage”.
- Now right click on package and New- > Class. Give appropriate name for class as well. I am giving “Testclass”.
- Now you are set with Project -> Package – > Class.
- Now right click on Project folder and Build Path -> Configure Build Path – > Libraries .
- Now click on Add External Jars to add selenium webdriver jars or libraries. And select each and every jars from respective jar folder.
- Now selenium jars are configured with project. Now go to project to write code.
- To check selenium is working fine just place below code in Main function and run it.
seldriver = new FirefoxDriver();
seldriver.get(“YOUR URL PATH”);
after placing this code you will see some errors as libraries are not imported. Just mouse over where errors are showing and include those libraries which eclipse is suggesting.
(Make sure while including libraries for errors , those libraries are belong to selenium only like
Now just run the project and check whether google is opening. Now explore more on Selenium Web driver with Java TesNG , Happy Exploration.