

{"id":114077,"date":"2023-05-29T09:00:07","date_gmt":"2023-05-29T03:30:07","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=114077"},"modified":"2023-05-29T11:43:32","modified_gmt":"2023-05-29T06:13:32","slug":"selenium-assertions","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/selenium-assertions\/","title":{"rendered":"Selenium Assertions \u2013 Assert and Verify Method"},"content":{"rendered":"<p>One of the essential parts of Selenium testing is the ability to verify whether the test cases pass or fail. This is where assertions come into play. Assertions are an integral part of Selenium automation testing, and they help to validate that the test cases are working correctly. In this article, we will learn about assert and verify methods in selenium.<\/p>\n<h3>What are Selenium Assertions?<\/h3>\n<p>Selenium Assertions are commands that allow you to verify whether a particular condition is true or false in your test script. Assertions are used to validate the expected results of the test case against the actual results obtained. Assertions play a vital role in Selenium automation testing because they help you ensure that the web application behaves as expected.<\/p>\n<p>When you write a Selenium test script, you expect certain things to happen when you execute the script. For example, when you click on a button, you expect a new page to load. In such cases, you need to use assertions to verify that the expected behavior occurred. If the expected behavior did not occur, the test case fails, and you need to investigate the cause of the failure.<\/p>\n<h3>Categories of Assertions in Selenium<\/h3>\n<p>Assertions are an essential part of test automation, as they help in verifying whether the expected results match the actual results. There are two main types of assertions: hard assertions and soft assertions.<\/p>\n<h4>1. Hard Assertions in Selenium:<\/h4>\n<p>Hard assertions are used to test the expected outcome of a test case. If the assertion fails, the test case is immediately marked as failed, and the test execution stops. Hard assertions are considered &#8220;hard&#8221; because they halt the test execution if the expected outcome does not match the actual outcome. Examples of hard assertions include AssertEquals, AssertTrue, AssertFalse, and AssertNotNull.<\/p>\n<p>There are various methods of Hard Assertions. Some of them are as follows:<\/p>\n<p><strong>a. AssertEquals:<\/strong> This assertion method is used to compare expected and actual values. It checks whether the expected value is equal to the actual value or not. If the values are not equal, then the assertion fails and the test case will be marked as failed.<\/p>\n<p><strong>b. AssertNotEquals:<\/strong> This assertion method is used to compare expected and actual values. It checks whether the expected value is not equal to the actual value or not. If the values are equal, then the assertion fails and the test case will be marked as failed.<\/p>\n<p><strong>c. AssertTrue:<\/strong> This assertion method is used to verify a condition that should be true. If the condition is true, then the test case passes. If the condition is false, then the assertion fails and the test case will be marked as failed.<\/p>\n<p><strong>d. AssertFalse:<\/strong> This assertion method is used to verify a condition that should be false. If the condition is false, then the test case passes. If the condition is true, then the assertion fails and the test case will be marked as failed.<\/p>\n<p><strong>e. AssertNull:<\/strong> This assertion method is used to verify that a value is null. If the value is null, then the test case passes. If the value is not null, then the assertion fails and the test case will be marked as failed.<\/p>\n<p><strong>f. AssertNotNull:<\/strong> This assertion method is used to verify that a value is not null. If the value is not null, then the test case passes. If the value is null, then the assertion fails and the test case will be marked as failed.<\/p>\n<h4>2. Selenium Soft Assertions:<\/h4>\n<p>Soft assertions, also known as &#8220;assertion softening,&#8221; are used to verify multiple conditions within a test case. Even if the assertion fails, the test case continues to execute, and all the failed assertions are reported at the end of the test. Soft assertions are considered &#8220;soft&#8221; because they do not halt the test execution if an assertion fails, and the test continues to execute. Examples of soft assertions include AssertAll, AssertThat, and Verify.<\/p>\n<p>Some methods of soft assertions include:<\/p>\n<p><strong>a. assertAll():<\/strong> This method is used to assert all the recorded failures in a test case. It checks if any assertion has failed, and if so, it throws an Assertion Error containing all the failure messages.<\/p>\n<p><strong>b. assertThat():<\/strong> This method is used to perform various types of soft assertions on the actual value against the expected value using various matcher methods. The test continues to execute even if an assertion fails and reports all the failed assertions at the end.<\/p>\n<p><strong>c. fail():<\/strong> This method is used to record a failure in a test case without stopping the execution of the test. This method can be used to add a custom message to a soft assertion failure.<\/p>\n<p>Overall, the choice between hard and soft assertions depends on the testing requirements and the nature of the test case. Hard assertions are suitable for situations where the test case cannot proceed if an expected condition fails. Soft assertions are more suitable for scenarios where it is necessary to validate multiple conditions within a single test case.<\/p>\n<h3>Difference between Selenium Hard and Soft Assertions<\/h3>\n<table>\n<tbody>\n<tr>\n<td><\/td>\n<td><b>Hard Assertions<\/b><\/td>\n<td><b>Soft Assertions<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Failure<\/span><\/td>\n<td><span style=\"font-weight: 400\">Immediately fails the test case and stops test execution<\/span><\/td>\n<td><span style=\"font-weight: 400\">Continues executing the test case even if assertion fails, and reports all failed assertions at the end<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Usage<\/span><\/td>\n<td><span style=\"font-weight: 400\">Used to test the expected outcome of a test case<\/span><\/td>\n<td><span style=\"font-weight: 400\">Used to verify multiple conditions within a single test case<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Type of Assertion<\/span><\/td>\n<td><span style=\"font-weight: 400\">Typically uses assert methods like assertEquals, assertTrue, etc.<\/span><\/td>\n<td><span style=\"font-weight: 400\">Typically uses methods like assertAll, assertThat, verify, etc.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Impact<\/span><\/td>\n<td><span style=\"font-weight: 400\">Has a greater impact on test execution<\/span><\/td>\n<td><span style=\"font-weight: 400\">Has a lower impact on test execution<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">Validation<\/span><\/td>\n<td><span style=\"font-weight: 400\">Used to validate the state of a single element or a small group of elements<\/span><\/td>\n<td><span style=\"font-weight: 400\">Used to validate the state of multiple elements or a larger group of elements<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Selenium Assert Methods<\/h3>\n<p>There are various types of Selenium Assertions that you can use in your test scripts. Some of the most commonly used Selenium Assertions are:<\/p>\n<p><strong>1. assertEqual:<\/strong> The assertEqual method compares two values and returns True if they are equal, or False if they are not.<\/p>\n<p><strong>2. assertNotEqual:<\/strong> The assertNotEqual method compares two values and returns True if they are not equal, or False if they are.<\/p>\n<p><strong>3. assertTrue:<\/strong> The assertTrue method checks whether a given condition is true or not. If the condition is true, it returns True; otherwise, it raises an assertion error.<\/p>\n<p><strong>4. assertFalse:<\/strong> The assertFalse method checks whether a given condition is false or not. If the condition is false, it returns True; otherwise, it raises an assertion error.<\/p>\n<p><strong>5. assertIn:<\/strong> The assertIn method checks whether a given item is present in a list or not. If the item is present, it returns True; otherwise, it raises an assertion error.<\/p>\n<p><strong>6. assertNotIn:<\/strong> The assertNotIn method checks whether a given item is not present in a list or not. If the item is not present, it returns True; otherwise, it raises an assertion error.<\/p>\n<p><strong>7. assertIs:<\/strong> The assertIs method checks whether two objects are the same or not. If the objects are the same, it returns True; otherwise, it raises an assertion error.<\/p>\n<p><strong>8. assertIsNot:<\/strong> The assertIsNot method checks whether two objects are not the same or not. If the objects are not the same, it returns True; otherwise, it raises an assertion error.<\/p>\n<p><strong>9. assertRaises:<\/strong> The assertRaises method checks whether a specific exception is raised or not. If the exception is raised, it returns True; otherwise, it raises an assertion error.<\/p>\n<p><strong>10. assertRaisesRegex:<\/strong> The assertRaisesRegex method checks whether a specific exception is raised with a matching regular expression or not. If the exception is raised with a matching regular expression, it returns True; otherwise, it raises an assertion error.<\/p>\n<h3>Using Selenium Assertions in Python:<\/h3>\n<p>Let us now look at how to use Selenium Assertions in Python. For this tutorial, we will be using the Python Selenium module and the Chrome driver. Firstly You need to <a href=\"https:\/\/sites.google.com\/a\/chromium.org\/chromedriver\/\">download the Chrome driver.<\/a><\/p>\n<p>Then we need to install the Selenium module using the following command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">pip install selenium<\/pre>\n<p>After installing the Selenium module, we need to import the required libraries in our Python script:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from selenium import webdriver\r\nfrom selenium.webdriver.common.keys import *<\/pre>\n<p>Now, let&#8217;s create a simple Selenium test script that searches for a string on Google and verifies the page title:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">from selenium import webdriver\r\nfrom selenium.webdriver.common.keys import Keys\r\nimport time\r\n\r\ndriver = webdriver.Chrome()\r\n\r\ndriver.get(\"https:\/\/www.google.com\")\r\n\r\nsearch_box = driver.find_element_by_name(\"q\")\r\nsearch_box.send_keys(\"Selenium Assertions\")\r\n\r\nsearch_box.send_keys(Keys.RETURN)\r\n\r\ntime.sleep(5)\r\n\r\nassert \"Selenium Assertions - Google Search\" in driver.title\r\n\r\ndriver.quit()<\/pre>\n<p>In the above script, we first create a new instance of the Chrome driver and navigate to the Google website. We then find the search box element and enter the search term &#8220;Selenium Assertions.&#8221; We press Enter to perform the search and wait for the page to load.<\/p>\n<p>Finally, we use the assert statement to verify that the page title contains the search term &#8220;Selenium Assertions.&#8221; If the page title does not contain the search term, the assert statement will raise an AssertionError and the test case will fail.<\/p>\n<h3>Using Selenium Assertions in Java:<\/h3>\n<p>Now, let&#8217;s look at how to use Selenium Assertions in Java. For this tutorial, we will be using Eclipse as our Java IDE and the Chrome driver.<\/p>\n<p>First, we need to <a href=\"https:\/\/www.selenium.dev\/downloads\/\">download Selenium Java client driver<\/a>. We also need to <a href=\"https:\/\/sites.google.com\/a\/chromium.org\/chromedriver\/\">download the Chrome driver<\/a>.<\/p>\n<p>Once we have downloaded the required drivers, we need to create a new Java project in Eclipse. Then add the Selenium Java client driver and Chrome driver to the project build path.<\/p>\n<p>Next, we can create a simple Selenium test script that searches for a string on Google and verifies the page title:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">import org.openqa.selenium.By;\r\nimport org.openqa.selenium.Keys;\r\nimport org.openqa.selenium.WebDriver;\r\nimport org.openqa.selenium.chrome.ChromeDriver;\r\nimport org.junit.Assert;\r\n\r\n\r\npublic class SeleniumAssertionsExample {\r\npublic static void main(String[] args) {\r\nSystem.setProperty(\"webdriver.chrome.driver\", \"path\/to\/chromedriver\");\r\nWebDriver driver = new ChromeDriver();\r\ndriver.get(\"https:\/\/www.google.com\");\r\ndriver.findElement(By.name(\"q\")).sendKeys(\"Selenium Assertions\" + Keys.RETURN);\r\ntry {\r\nThread.sleep(5000);\r\n} catch (InterruptedException e) {\r\ne.printStackTrace();\r\n}\r\nAssert.assertTrue(driver.getTitle().contains(\"Selenium Assertions - Google Search\"));\r\ndriver.quit();\r\n}\r\n}<\/pre>\n<p>In the above script, we first set the Chrome driver path and create a new instance of the Chrome driver. We navigate to the Google website and find the search box element. Then eenter the search term &#8220;Selenium Assertions&#8221; and press Enter to perform the search. We wait for the page to load and then use the Assert statement to verify that the page title contains the search term &#8220;Selenium Assertions.&#8221; If the page title does not contain the search term, the Assert statement will throw an AssertionError and the test case will fail.<\/p>\n<h3>Conclusion:<\/h3>\n<p>Selenium Assertions play a vital role in Selenium automation testing as they help to verify whether the test cases pass or fail. There are various types of Selenium Assertions available, such as AssertTrue, AssertFalse, AssertEquals, etc. It can be used to verify different aspects of a web page.<\/p>\n<p>In this article, we learned about Selenium Assertions and how to use them in Python and Java. We saw how to create a simple Selenium test script that searches for a string on Google and verifies the page title using Assertions.<span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:216,&quot;href&quot;:&quot;https:\\\/\\\/sites.google.com\\\/a\\\/chromium.org\\\/chromedriver&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20231118234835\\\/https:\\\/\\\/sites.google.com\\\/a\\\/chromium.org\\\/chromedriver\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-07 15:34:02&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2025-12-19 12:57:27&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-25 23:29:20&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-29 06:14:17&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-23 16:27:41&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-29 06:26:53&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-09 09:37:38&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-07 05:24:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-11 17:37:12&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-30 11:12:08&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-20 00:26:30&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-08 09:38:29&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-18 11:46:15&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-13 06:30:58&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-19 20:16:43&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-26 04:44:21&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-26 04:44:21&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:217,&quot;href&quot;:&quot;https:\\\/\\\/www.selenium.dev\\\/downloads&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20250926074301\\\/https:\\\/\\\/www.selenium.dev\\\/downloads\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-07 15:34:05&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-19 13:06:22&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-23 16:27:47&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-29 06:27:05&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-09 09:37:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-07 05:26:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-11 17:37:16&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-30 11:12:19&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-20 00:26:40&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-08 09:38:33&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-19 20:16:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-26 04:44:24&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-26 04:44:24&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the essential parts of Selenium testing is the ability to verify whether the test cases pass or fail. This is where assertions come into play. Assertions are an integral part of Selenium&#46;&#46;&#46;<\/p>\n","protected":false},"author":581,"featured_media":114079,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22825],"tags":[27552,27553,27551,27554],"class_list":["post-114077","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-selenium-tutorials","tag-selenium-assert-and-verify","tag-selenium-assert-method","tag-selenium-assertions","tag-selenium-verify-method"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Selenium Assertions \u2013 Assert and Verify Method - DataFlair<\/title>\n<meta name=\"description\" content=\"Selenium Assertions help to verify whether test cases pass or fail. Learn about types of selenium assertions, assert and verify methods etc.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/selenium-assertions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Selenium Assertions \u2013 Assert and Verify Method - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Selenium Assertions help to verify whether test cases pass or fail. Learn about types of selenium assertions, assert and verify methods etc.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/selenium-assertions\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-29T03:30:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-29T06:13:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/04\/selenium-assertions.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Selenium Assertions \u2013 Assert and Verify Method - DataFlair","description":"Selenium Assertions help to verify whether test cases pass or fail. Learn about types of selenium assertions, assert and verify methods etc.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/selenium-assertions\/","og_locale":"en_US","og_type":"article","og_title":"Selenium Assertions \u2013 Assert and Verify Method - DataFlair","og_description":"Selenium Assertions help to verify whether test cases pass or fail. Learn about types of selenium assertions, assert and verify methods etc.","og_url":"https:\/\/data-flair.training\/blogs\/selenium-assertions\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2023-05-29T03:30:07+00:00","article_modified_time":"2023-05-29T06:13:32+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/04\/selenium-assertions.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/selenium-assertions\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/selenium-assertions\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445"},"headline":"Selenium Assertions \u2013 Assert and Verify Method","datePublished":"2023-05-29T03:30:07+00:00","dateModified":"2023-05-29T06:13:32+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/selenium-assertions\/"},"wordCount":1728,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/selenium-assertions\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/04\/selenium-assertions.webp","keywords":["selenium assert and verify","selenium assert method","Selenium Assertions","selenium verify method"],"articleSection":["Selenium Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/selenium-assertions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/selenium-assertions\/","url":"https:\/\/data-flair.training\/blogs\/selenium-assertions\/","name":"Selenium Assertions \u2013 Assert and Verify Method - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/selenium-assertions\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/selenium-assertions\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/04\/selenium-assertions.webp","datePublished":"2023-05-29T03:30:07+00:00","dateModified":"2023-05-29T06:13:32+00:00","description":"Selenium Assertions help to verify whether test cases pass or fail. Learn about types of selenium assertions, assert and verify methods etc.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/selenium-assertions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/selenium-assertions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/selenium-assertions\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/04\/selenium-assertions.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2023\/04\/selenium-assertions.webp","width":1200,"height":628,"caption":"selenium assertions"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/selenium-assertions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Selenium Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/selenium-tutorials\/"},{"@type":"ListItem","position":3,"name":"Selenium Assertions \u2013 Assert and Verify Method"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/c187795dc82ab948373cca526df7c445","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2302ebc438084d2f1f993edc1996a0aae01332e81f3227cba8df0c48ec010ca4?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam6\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/114077","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=114077"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/114077\/revisions"}],"predecessor-version":[{"id":114463,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/114077\/revisions\/114463"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/114079"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=114077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=114077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=114077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}