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

Popular Categories

selenium-difference between assertion and verify

+1 vote
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

+1 vote
1 answer 267 views
+2 votes
1 answer 2,549 views
+4 votes
4 answers 1,270 views
0 votes
0 answers 97 views
0 votes
5 answers 515 views
+7 votes
1 answer 504 views
+1 vote
1 answer 240 views
+7 votes
8 answers 7,324 views

Not a Member yet?

Ask to Folks Login

My Account
751 Folks are online
55 members and 696 guest online
Your feedback is highly appreciated