Tag Archives: testing

In Selenium what is the difference between “Assert” and “Verify”

When you have a series of test cases in a script using an “assert” will halt the test run when it encounter a failure. On the other hand with a “verify” command it will continue to run and log the rest of the tests regardless of failures.

So the choice really dependent on the function you are testing. For example, if you have an email submission form and you want to test that the data verification module works for each input then you can test each input and just return the fail/pass results. Here you will use a verify statement.

But if on the same email submission form if you are testing the email submission functionality then if the first field, lets say, First name is not functioning properly then there is no point in testing the rest of the submission process, Here you will use an assert.

In practice however you use a combination of both. The Selenium documentation gives details of how this is done here.