What is difference between assert and verify commands?



What is difference between assert and verify commands?..

Answer / Situ Singh

In Selenium WebDriver, both 'assert' and 'verify' are used for testing conditions. However, the main difference lies in when they check the condition: 'Assert' checks a condition immediately (synchronously), whereas 'Verify' checks a condition periodically (asynchronously). 'Assert' throws an exception if the condition is not met, while 'Verify' does not. Also, it's recommended to use 'assert' for critical conditions and 'verify' for non-critical ones.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Selenium Interview Questions

What is the object repository?

1 Answers  


How is assert command different from verify command?

1 Answers  


What / supported operating system platforms Selenium?

1 Answers  


How can I click the div tag using xpath <div> <input> <input> <input> <input>.....suresh....</input> </input> </input> </input> </div>

4 Answers   Value Labs,


If the test case frame contains several test cases, how can one execute just the selected one of those test cases?

1 Answers  


What methods of robot class do you know?

1 Answers  


when autoit is used?

1 Answers  


How do you simulate scroll down action?

1 Answers  


Disadvantages of Hybrid Framework?

1 Answers   L&T,


How many types of webdriver api's are available in selenium?

1 Answers  


In selenium what are breakpoints and startpoints?

1 Answers  


What are the significant changes in upgrades in various selenium versions?

1 Answers  


Categories