Spread the love

What Is The Difference Between Assert And Verify In Selenium

Spread the love

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* 





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.




Spread the love
READ  Which is better Xpath or DOM?
Animesh Chatterjeehttps://techtravelhub.com/
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 ani01104@gamil.com

Related Articles

How to Resolve NoSuchSessionException in selenium free?

How to Resolve NoSuchSessionException in selenium? NoSuchSessionException in Selenium is a tricky...

Comments

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Recent Posts

Super Keyword in Java Simplified

Super Keyword Super Keyword in Java Simplified: Java defines a special...

Learn Object Repository in UFT in An Efficient and Fast Manner

Object Repository in UFT The post will cover the following...

Learn What Primary Tools For Test Automation

Primary Tools For Test Automation According to the Gartner report...

EDITOR PICKS


Spread the love