ExecuteAutomation

Handling multiple assert in Selenium with Assert.multiple of NUnit 3.6

In this post we will discuss how to handle multiple assert in Selenium with Assert.multiple of NUnit 3.6, this is one of the most requested feature of NUnit.

NUnit 3.6

Nunit 3.6 released by Jan 9th 2017 has number of notable improvement and features something like this

Where is Assert.Multiple helpful ?

Consider a scenario something like this Lets say we have to test multiple properties of an UI element in Selenium

In Nunit test framework, if the first assert fails (not meeting the condition), then the second assertion will not even takes place and the whole test fails (which we all know) But using new Assert.Multiple method, the code can be written something like this

Benefits of Assert.Multiple

Here is the complete video of the above discussion Here is the complete source code of the above video https://gist.github.com/executeautomation/c52f8094846d95fbb3ebbb47b7062243 Thanks for reading the post and watching the video!!! Please leave your comments and let me know if there is anything I should update in this post. Thanks, Karthik KK