Verify vs. assert in Selenium

  • 1 Replies
Verify vs. assert in Selenium
« on: May 31, 2016, 20:53:00 pm »
If I understand correctly, assert will fail an entire test case, while verify will only note the failure of that condition and the test case will continue.

So with verify I get test results for multiple conditions even if one fails. One failed condition is sufficient to tell that the test will fail.

In what situations is one method preferred over the other ?

Re: Verify vs. assert in Selenium
« Reply #1 on: June 02, 2016, 10:07:50 am »
I usually use asserts as entry points into tests.
If the assertion passes, I run all verify conditions.
e.g. if I'm checking the contents of a table result from a piece of code, I would assert that the table exists, and then verify <tr><td> content data.


Sitemap 1 2 3 4 5 6 7 8