Difference Between Assert And Verify In Selenium
Difference Between Assert And Verify In Selenium

Difference Between Assert And Verify In Selenium:

Here is a small effort to understand the difference between to technologies of selenium called..

  • Assert*
  • Verify* 

Assert* will fail the test if something is missing and execution will stop thereVerify* will report the missing item at last without stopping the execution
One can easily understand what went wrong during executionOne has to go through result files or log to understand why it got failed
Live visual display of errorTest engineer has to follow the script or result file to create such environment
Mostly used in debug mode,This can be used in releases or in production to make sure everything is ok and will not affect other userMostly used in test automation execution during release,UAT
Test coverage becomes lesserTest coverage is higher
When an assert fails the test is immediately abortedwhen a verify fails the test will continue till end

Example of Asset Statement:

Assert.IsFalse(selenium.IsTextPresent("Ask QTP"));
catch (AssertionException e)

Example of Verify Statement:

verifyEquals(selenium.getText("arg1"), "arg2"); 

Hope you like this post . Please let me know about thought on this. Please post your comment below.

Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

I am the founder and owner of the blog - TechTravelHub.com, always love to share knowledge on test automation,tools,techniques and tips.I am a passionate coder of Java and VBScript.I also publish articles on Travel ideas and great honeymoon destinations.Apart from these, I am a gear-head,love to drive across India. I have shared lots of articles here on How to travel several parts of India.Customization of cars aka car modification is my another hobby.Get in touch with me on [email protected]

Write A Comment