What is difference between Assert and Verify in Selenium

0 votes
I was working on selenium, though I am just a beginner. I wanted to know as what is the difference between Assert and Verify?

Can someone explain me with an example?
Dec 31, 2018 in Selenium by Sradha
• 1,760 points
37,388 views

1 answer to this question.

0 votes

Hello, talking about the definition. 
Assert: If the assert condition is true then the program control will execute the next test step but if the condition is false, the execution will stop and further test step will not be executed.
whereas,
Verify: There won’t be any halt in the test execution even though the verify condition is true or false.

Example:- 

When an assert statement fails then all the other test case after that won't execute. This is a problem, but again its good practice to use try catch block to avoid this situation.

Verify is used in less critical things. Cases where we can move forward even if the other test cases fails.

I hope this helps. 

Enroll for the Selenium online course here and learn from the industry experts!

Thanks!

answered Dec 31, 2018 by Prasad

Related Questions In Selenium

0 votes
2 answers
+1 vote
2 answers

What is the difference between findElement and findElements in Selenium Webdriver?

FindElement Command -This method locates for the ...READ MORE

answered Feb 11, 2020 in Selenium by anonymous
8,022 views
0 votes
1 answer

What is the difference between getWindowHandle() and getWindowHandles() methods in Selenium WebDriver?

Hey Jennifer, difference between getWindowHandle() and getWindowHandles() ...READ MORE

answered Jun 4, 2019 in Selenium by Anvi
• 14,150 points
13,528 views
0 votes
1 answer

What is the difference between thoughtworks.selenium and openqa.selenium selenium?

thoughtworks.selenium is the original Selenium (aka Selenium 1, ...READ MORE

answered Apr 13, 2018 in Selenium by king_kenny
• 3,710 points
2,663 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
12,619 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
8,572 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
6,629 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,519 views
0 votes
1 answer

What is the difference between WebDriver and RemoteWebdriver in Selenium?

Hey Ishan, the difference between Webdriver and ...READ MORE

answered May 10, 2019 in Selenium by Pratibha
• 3,690 points
10,326 views
0 votes
1 answer

What is the difference between HUB and NODE?

Hub:- It is the central point where you ...READ MORE

answered Jan 14, 2019 in Selenium by saksham
2,343 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP