About Me

Page views

Powered by Blogger.

Followers

Friday 8 May 2015


So How TestNG makes Selenium tests easier ?

TestNG  :
TestNG is a testing framework that overcomes the limitations of another popular testing framework called JUnit. The "NG" means "Next Generation". Most Selenium users use this more than JUnit because of its advantages. There are so many features of TestNG.


Advantages of TestNG over JUnit

1. Annotations are easier to understand.

2. Test cases can be grouped more easily.

3. Parallel testing is possible.

Annotations in TestNG are lines of code that can control how the method will be executed. 

Example Annotation

@Test (Priority =0)     

public void goHomePage(){
driver.get(baseUrl);
Assert.assertEquals(driver.getTitle(),"Welcome Mercury Tours");

TestNG can generate reports based on our Selenium test results.
WebDriver has no native mechanism for generating reports.
TestNG can generate the report in a readable format.
TestNG simplifies the way the tests are coded.

Example for usual structure some what difficult to read .


 Example TestNG structure easier to understand .






0 comments:

Post a Comment

Popular Posts

Copyright © Learn Selenium Yourself | Powered by Blogger
Design by Duan Zhiyan | Blogger Theme by NewBloggerThemes.com