Selenium is one of the best automation tools in the market.
TestNG is the next generation Java Unit Testing framework.
Together they can be used to automate a lot of applications having a GUI.
The Installation guide
You will need the following:
- Eclipse
- Selenium
- TestNG
- Firefox
Installing Eclipse
You can install Eclipse by downloading the zip package from Eclipse Foundation. Choose Eclipse IDE for JAVA EE Developers. Make sure you have Java 1.7 installed on your machine before you start eclipse.
Installing Selenium
Download the Selenium Java zip from Selenium Java downloads.
Installing TestNG
Start Eclipse and the installation are present here: http://testng.org/doc/eclipse.html
Bring it all together - Automating a Google Search in Selenium
1. Start Eclipse and create a project.
2. Make sure you add all the jar files downloaded from Selenium, including those present in libs folder. Also add the TestNG library.
3. Create a class GoogleSearch and add the following contents
4. Run the project as a TestNG test.
How things work?
Since TestNG is similar to JUnit, magic is done with the help of annotations. See this TestNG annotations
.
If everything goes well, a search query will be entered in the Google search box.
2 comments :
Very Nice and Very helpful for beginners like us. Thanks Again..
Please explain TestNG more for beginners with Selenium webdriver.
Post a Comment