Hey there! any question in your mind? Ask It Now!.

Popular Categories





selenium-difference between assertion and verify

+1 vote
776 views
asked in Automation Testing Interview Question by kaviraj (330 points)
Please explain the difference between assertion and verify in selenium and also give a example.

2 Answers

0 votes
answered by Julián Botello Cano
Dear Kavraj, In most testing software that use "assertion" & "verify", the main difference is that using "assertion" when the condition has not met the software stops, unlike verification, it simply returns a yes or a no and the test code continues running. You can use the help of Selenium Ide to see and learn easily differents examples. Best regards. Have a nice day.
commented by Sohail Malik
To add more on Julián Botello Cano comments, When we use Assert statement we do not have to use an "if-Else" (JUnit) logical statement as the Assert statement will verify the result for us and return the correct value. As mention early by Julian it is important to note the script will be Abort in case of failure. To avoid aborting the script we can include the assert command in the Try-Catch block, hope that help.
0 votes
answered by Tim Western
I'm presuming this question is about SeleniumIDE and not Selenium. Assertions aren't really seleniums thing they are the perview of some 'test framework' that handles things like Assertions, like MiniTest, Rspec, NUnit, JUnit, etc.

For SeleniumIDE, an Assertion will error and not do further steps, where as verify will attempt to continue making assertions.

Also see: http://stackoverflow.com/questions/5743848/assert-vs-verify-in-selenium

Related Questions

+7 votes
1 answer 502 views
+1 vote
1 answer 238 views

Not a Member yet?

Ask to Folks Login

My Account
369 Folks are online
31 members and 338 guest online
Your feedback is highly appreciated