Mobile QA Zone

A Mobile Application Testing Community

What is the difference between assert and verify commands while performing automation using JAVA language and Selenium webdriver? Which one should I prefer ?

Views: 96

Reply to This

Replies to This Discussion

As per the ideal approach used by most automated testing services providers, Assert and Verify both commands are used to find that a given input is present or not on a webpage. Difference between Assert and Verify command is as:

Assert command :
In automation tests when an “assert” command fails it terminate the execution. So when the Assertion fails, all the test steps after that line of code are terminated. Mainly the assert command is used when the end result of the check value is important for the next steps.
If the assert condition is true then the execution will be continue and if the condition is false, the execution will be terminated.

Example: Assert.assertTrue(------);
Verify command:
In Automation tests when a “verify” command fails, the test will continue executing and will not stop. Mainly the Verify command is used to check less critical things. In such type of cases where we move forward even though the end result of the check value is failed.

SoftAssert softAssert = new SoftAssert();;


© 2019   Created by Anurag Khode.   Powered by

Badges  |  Report an Issue  |  Terms of Service

Welcome to Mobile QA Zone, a Next Generation Software Testing Community.Invite your friends to join this community.Write to us to become a featured member.