Assertions are very useful to check your expected result and skip execution if assertion fails on run time. If you are selenium IDE user, you can read all these selenium IDE ASSERTION COMMANDS examples posts to use them in your test cases for your web application. Before describing about assertNull assertion of testngI recommend you all to READ OTHER WEBDRIVER ASSERTION METHOD examples for your reference.

When you are working with selenium webdriver, you must be aware about different kind of assertions which are available. If you have a enough knowledge about testng assertions, You can create very effective test cases for your test scenarios. assertEquals, assertNotEquals and assertTrue assertions are already explained in my previous posts. Now let we try to understand usage of testng assertfalse in selenium webdriver.

Previously we have learnt two assertions of selenium webdriver software testing tool. You can view practical example pages of selenium webdriver assertionsassertEquals and assertNotEquals before learning asserttrue in selenium. There is also one another related assertion is assertFalse(condition) assertion but we will look about it in my next post.

As described in my previous post, assertEquals assertion is useful to compare two string, boolean, byte[], char, double, float, int, etc.. and based on assertion result,  Your test method will pass or fail. This pass or fail indication will helps you in your testing process. So this is the very good function in selenium WebDriver which helps us to find and log issue. Please note one thing once more is - Use hard assertions in selenium webdriver only when you wants to skip remaining test execution on assertion fail. If you wants to continue execution on assertion failure, you can use TestNg soft assertions. We will discuss about it in my upcoming post.

There are many assertions available in Selenium WebDriver software testing tool with TestNG framework and we will look at all of then one by one. Assertions are important and very useful in any software automation tools to assert something during your test execution. If you know, Selenium IDE software testing tool has many built in assertion commands and if you are selenium IDE user then you can view set of selenium IDE assertion command examples on THIS LINK.

It is very important for us to know the each and every way of testng.xml configuration to include/exclude selected test methods or packages in execution. You can view my posts to know how to include/exclude SELECTED PACKAGE or SELECTED TEST METHODS from selenium webdriver test suite execution. There is also one another way of including or excluding selected test method using regular expression. Let me describe it with one simple example.

Now you are already aware about HOW TO INCLUDE OR EXCLUDE SELECTED TEST METHODS IN TEST SUITE. Now our next tutorial is about how to include or exclude selected package from execution of test suite. Supposing you have multiple packages in your webdriver test suite and you wants to run only specific selected package then how will you do it? Let we look at simple example for the same.

If you are using selenium webdriver with TestNg framework then you can easily run your selected test methods from selected classes. Supposing you have a two classes in your package and first class have three test methods and second class have five test methods. Now you wants to run only one test method from first class and two test methods from second class then you can configure it very easily in testng.xml file. In sort, you can include or exclude selected test methods from execution. Let me show you how to do it with simple webdriver test configured by testng.xml file.

TestNG is very useful and powerful framework for selenium webdriver. We need to configure our tests based on our requirements or test scenarios. We are going very slowly with TestNG framework to understand each and everything clearly with examples so that it can help you to configure your test in any king of situations. In my previous posts, we have learnt about HOW TO RUN SPECIFIC CLASS FROM DIFFERENT PACKAGE USING testng.xml and HOW TO RUN SINGLE OR MULTIPLE CLASSES FROM ONE PACKAGE USING testng.xml. So now you can configure your testng.xml file to run any specific class from any package if you have read both previous posts.

Now you are already aware about HOW TO CREATE testng.xml FILE to configure and run your webdriver test. The main reason behind popularity of TestNG framework for webdriver is we can configure our test as per our requirements. I have listed some Similarities/Differences between Junit and TestNG framework In THIS POST. In my previous post, We have already seen example of how to configure testng.xml file to run single/multiple webdriver test classes of same package. Now let me show you an example of how to create test suite using classes from different packages.

As i have described in my previous post, We can configure our webdriver test or webdriver test suits for software testing project in testng.xml file. In my previous post, we have seen how to create testng.xml file to run single test class for software web application. Also If you don't know how to create and run first TestNG-WebDriver test, You can VIEW THIS POSTNow supposing you have two/multiple classes in your test suite for software web application then how will you run them? We can run both the classes in same test as well in 2 different tests too for software web application.

Introduction Of testng.xml File
In TestNG framework, We need to create testng.xml file to create and handle multiple test classes. testng.xml is the file where we can configure our webdriver software automation test, set software test dependency, include or exclude any software test method or class or package, set priority etc.. We will learn each and every thing about TestNG usage in my future posts. Right now let me describe you how to create testng.xml

Our next step to do is - TestNG software test case creation in eclipse after installation of TestNG in eclipse. You can VIEW TESTNG INSTALLATION STEPS in my earlier post if you have not configured TestNG in your eclipse. Now let me describe you steps of writing your first selenium webdriver software automation test case with TestNG.

As you know, JUnit and TestNG are very popular unit testing frameworks for java software developers and we can use them in our webdriver test execution for any software web application. Till now, I have described all WEBDRIVER TUTORIALS with junit framework. Many peoples are asking me to describe the similarities and difference between JUnit and TestNG Framework. First of all let me give you few similarities of JUnit and TestNG frameworks and then I will tell you difference between both of them.

(Note : Bellow given similarities and differences are based on JUnit 4 version.)

Similarities Between JUnit and TestNG
  1. We can create test suite in JUnit and TestNG both frameworks.
  2. Timeout Test Is possible very easily in both the frameworks.
  3. We can ignore specific test case execution of software web application from suite in both the frameworks.
  4. It is possible to create expected exception test for software web application in both the frameworks.
  5. Annotations - Few annotations are similar in both frameworks suite like @Test, @BeforeClass, @AfterClass. JUnit's Annotations @Before and @After are similar to TestNG's @BeforeMethod and @AfterMethod annotations.
Difference Between JUnit and TestNG
  1. In TestNG, Parameterized test configuration is very easy while It is very hard to configure Parameterized test in JUnit.
  2. TestNG support group test but it is not supported in JUnit.
  3. TestNG has a feature to configure dependency test. Dependency test configuration for software web application is not possible in JUnit.
  4. TestNG support @BeforeTest, @AfterTest, @BeforeSuite, @AfterSuite, @BeforeGroups, @AfterGroups which are not supported in JUnit.
  5. Test prioritization, Parallel testing is possible in TestNG. It is not supported by JUnit.
  6. View more features of TestNG @ THIS LINK .
If you knows more differences or features then you can post it by commenting bellow.

To use TestNG Framework in Eclipse, First of all we have to install it. Installation of TestNG software testing framework in Eclipse is very easy process. As I described in my previous post, TestNG is very powerful and easy to use framework and it is supported by tools like Eclipse, Maven, IDEA, etc.. Here we are going to use TestNG Framework with Eclipse so obviously you must have installed latest Java development kit (JDK) software in your system and you must have Eclipse. View THIS POST to know how to download and install JDK(Java) software in windows.

TestNG is unit testing framework and it has been most popular in very sort time among java software developers and selenium webdriver software automation test engineers. I can say, TestNG has not only most of all the features of JUnit but also many more advanced features in terms of selenium webdriver testing framework. Basically,

Now you can easily select or deselect any specific option from select box or drop down as described in my earlier POST 1, POST 2 and POST 3. All these three posts will describe you different alternative ways of selecting options from list box or drop down. Now let me take you one step ahead to describe you the use of deselectAll() and isMultiple() methods in selenium webdriver.

Adding selection or removing selection from list box are very common actions for list box. Selenium WebDriver has 3 alternate options to select or deselect value from list box. It is very important to learn all three methods of selecting or deselecting option from list box because if one is not possible to implement in your test then you must be aware about alternate option. I already described 3 selection options in my earlier posts - Selecting specific option BY VISIBLE TEXT, BY VALUE or BY INDEX  from drop down or list box.

First of all please look at THIS POST where I have described difference between label and value in drop down or list box. Don't get confused from these two words. Selenium IDE has many assertion commands and all of them are designed for different purpose. Here i am going to describe you "assertSelectedLabels"

Setting wait condition in Selenium IDE or webdriver means pausing your test case execution till expected wait condition match with actual wait condition. You can view different wait condition examples for selenium IDE in THIS LINK and for web driver on THIS LINK. Selenium IDE has 2 related waiting commands to

Sometimes you need to set time out for your webdriver test or you need to set expected exception condition for your test. Supposing you have written test for one module and you wants to set timeout for your test. Here timeout means allowed maximum time to complete full test. Same way, You are expecting some exception during your webdriver test execution and that exception is acceptable.If you are using junit framework for your webdriver test then you can do it very easily. We have seen example of - how to Ignore specific webdriver test using junit's @Ignore annotation in THIS POST. Now let me describe how to write timeout test and exception test in junit with examples.

Many readers are asking me the difference between JUnit annotations @Before VS @BeforeClass and @After VS @AfterClass in webdriver software automation test. If you have read my JUNIT ANNOTATIONS POST, I have clearly described difference between @Before and @BeforeClass annotations and @After and @AfterClass annotations in bold text. Now let me describe once more and then we will look at practical example for both of them to use them in software automation test.