Ad Home

Theme images by kelvinjay. Powered by Blogger.

Travel

Header Ads

Java

Selenium

UFT

Framework

General QA Concept

BDD

» » What Is The Difference Between Assert And Verify In Selenium

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


  • Assert*
  • Verify* 





AssertVerify
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:
                        try 
                        { 
                                Assert.IsFalse(selenium.IsTextPresent("Ask QTP")); 
                        } 
                        catch (AssertionException e) 
                        { 
                                verificationErrors.Append(e.Message); 
                        } 


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.

«
Next
Newer Post
»
Previous
Older Post

No comments:

Leave a Reply