Difference between Selenium and TestNG
Am a beginner in Selenium and am trying to learn selenium on my own by googling. One thing which I noticed was in many of the posts which I read about selenium the name of the framework by name "TestNG" is common. I have understood that its a framework and with its Annotations and Test case compliance power, we can organize our Selenium test cases using the TestNG. But I have few queries regarding the same:
- By using the TestNG framework, should we modify the Selenium Code which we write?
- Are there any Coding standards which has to be mandatory used while using TestNG?
Please, do clarify my doubts. And even recommend some of the blogs/sites from where I can learn Selenium as a beginner.
Bogopo last edited by user
I have used Selenium and TestNG in the past to manage a lot of my automation and as Siva mentioned you do have the basics down. While TestNG is one of the most common Frameworks out there, it is not the only one, and you can use whatever one works for you. So long as you can import the Selenium drivers you can use any framework in which you are familiar, I've used Gallio, TestNG, PowerShell, Fitnesse/Fitnium as a wrapper and even Python/Robot to drive the tests. Find which one works for you.
Look for a way to organize your tests that make sense to you and your Users, I have added SpecFlow on top of my Test Cases to make the higher level descriptions more readable to Business Users. This allowed me to code with Selenium/Web Driver behind the scenes and do the kind of testing I wanted, while presenting a readable set of Test Cases to my Users.
As to your questions:
- You should not need to modify your code while using TestNG, although it depends on what features of TestNG you take advantage of; you probably could though I didn't when I originally set up my framework.
- Coding Standards I tend to think of as being specific to your company, if you don't already have some standards then check with your developers and see if you can co-opt theirs this way you have a standard across departments. Code then looks the same in your organization and it is easy for anyone to review, or even give your test code a code review - which you should do anyway.
There are plenty of places to learn, but it depends on your level of expertise. Check the examples at the Selenium site first, then if you feel comfortable you can look for more.