{"id":1322,"date":"2019-10-21T05:36:46","date_gmt":"2019-10-21T05:36:46","guid":{"rendered":"https:\/\/studysection.com\/blog\/?p=1322"},"modified":"2019-10-21T13:17:02","modified_gmt":"2019-10-21T13:17:02","slug":"common-exceptions-in-selenium","status":"publish","type":"post","link":"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/","title":{"rendered":"Common Exceptions in Selenium"},"content":{"rendered":"<div class=\"ss-blog\">\n<h2>What is an Exception?<\/h2>\n<p>An exception is an event that interrupts the execution of the program without giving the output. In simple words, any issue which stops your script in between the execution is an exception. When an exception occurs in the program then It halts the normal flow of the program and creates an object. The exception object contains a lot of debugging information such as method name, line number where the exception occurred and type of exception.<br \/>\n<\/p>\n<h2>Common Type of Exceptions:<\/h2>\n<p><\/p>\n<ol>\n<li>\n<h3>WebDriverException<\/h3>\n<p>When a code is not initializing the web driver or when the web driver performs actions right after closing the browser.\n<\/li>\n<li>\n<h3>NoSuchElementException<\/h3>\n<p>When an element does not identify on the web page during the run time process.\n<\/li>\n<li>\n<h3>ElementNotVisibleException<\/h3>\n<p>When a user tries to interact with an element that is hidden on the page. For Example, when a user tries to perform click action on the sub-heading in the drop-down list.\n<\/li>\n<li>\n<h3>ElementNotSelectableException<\/h3>\n<p>When an element is present but disable and not clickable on the web page.\n<\/li>\n<li>\n<h3>InvalidSelectorException<\/h3>\n<p>When a selected locator or selector does not return web element values. This exception occurs when a user does not select the web element and enters an invalid locator path.\n<\/li>\n<li>\n<h3>NoAlertPresentException<\/h3>\n<p>When the web driver does not find any alert or switching to the invalid alert which is not present on the web page.\n<\/li>\n<li>\n<h3>NoSuchFrameException<\/h3>\n<p>When the frame is not loaded on the web page or web driver switches to an invalid frame which is not present on the web page.\n<\/li>\n<li>\n<h3>NoSuchWindowException<\/h3>\n<p>When the selected window is not loaded and the web driver is switching to the wrong window.\n<\/li>\n<li>\n<h3>SessionNotFoundException<\/h3>\n<p>When session Id is not present and inactive in the given active session list.\n<\/li>\n<li>\n<h3>StaleElementReferenceException<\/h3>\n<p>Stale means no longer. This exception occurs when a reference variable is no longer on the DOM page. This happens due to the following reasons:<\/p>\n<ul>\n<li>The current page has refresh before locating to element on the page.<\/li>\n<li>Element is removed from the page.<\/li>\n<\/ul>\n<\/li>\n<li>\n<h3>TimeoutException<\/h3>\n<p>When a selected command takes more time than the given time limit to return the value.\n<\/li>\n<li>\n<h3>NoSuchAttributeException<\/h3>\n<p>When the attribute of an element is not finding on the web page.\n<\/li>\n<li>\n<h3>JavascriptException<\/h3>\n<p>It usually happens when a command executed by a user fails. For Example, a user tries to execute the script with an unidentified variable.\n<\/li>\n<li>\n<h3>ScreenshotException<\/h3>\n<p>When it is impossible or script fails to capture the selected screen.\n<\/li>\n<\/ol>\n<p>\n<small><em>A <a style=\"color:blue;\" href=\"https:\/\/www.studysection.com\/windows-10-advanced\">Windows 10 certification<\/a> can help you prove your skills in the Microsoft Windows 10 operating system and it can improve your chances of getting hired. StudySection offers a Windows 10 certification exam for beginner level as well as professional level individuals in the Microsoft Windows 10 operating system.<\/em><\/small>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>What is an Exception? An exception is an event that interrupts the execution of the program without giving the output.<\/p>\n","protected":false},"author":1,"featured_media":1323,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[227,228,225,226],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>StudySection Blog - Common Exceptions in Selenium<\/title>\n<meta name=\"description\" content=\"The exception object contains a lot of debugging information such as method name, line number where the exception occurred and type of exception.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"StudySection Blog - Common Exceptions in Selenium\" \/>\n<meta property=\"og:description\" content=\"The exception object contains a lot of debugging information such as method name, line number where the exception occurred and type of exception.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog Posts on famous people, innovations and educational topics\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/studysection\" \/>\n<meta property=\"article:published_time\" content=\"2019-10-21T05:36:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-10-21T13:17:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/10\/exceptions-in-selenium.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"300\" \/>\n\t<meta property=\"og:image:height\" content=\"200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin-studysection-blog\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@studysection\" \/>\n<meta name=\"twitter:site\" content=\"@studysection\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin-studysection-blog\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/\"},\"author\":{\"name\":\"admin-studysection-blog\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402\"},\"headline\":\"Common Exceptions in Selenium\",\"datePublished\":\"2019-10-21T05:36:46+00:00\",\"dateModified\":\"2019-10-21T13:17:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/\"},\"wordCount\":446,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/studysection.com\/blog\/#organization\"},\"keywords\":[\"Common Exceptions\",\"exception handling in selenium\",\"exceptions in selenium\",\"selenium exceptions\"],\"articleSection\":[\"Learn and Grow\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/\",\"url\":\"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/\",\"name\":\"StudySection Blog - Common Exceptions in Selenium\",\"isPartOf\":{\"@id\":\"https:\/\/studysection.com\/blog\/#website\"},\"datePublished\":\"2019-10-21T05:36:46+00:00\",\"dateModified\":\"2019-10-21T13:17:02+00:00\",\"description\":\"The exception object contains a lot of debugging information such as method name, line number where the exception occurred and type of exception.\",\"breadcrumb\":{\"@id\":\"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/studysection.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Common Exceptions in Selenium\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/studysection.com\/blog\/#website\",\"url\":\"https:\/\/studysection.com\/blog\/\",\"name\":\"Blog Posts on famous people, innovations and educational topics\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/studysection.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/studysection.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/studysection.com\/blog\/#organization\",\"name\":\"StudySection\",\"url\":\"https:\/\/studysection.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png\",\"contentUrl\":\"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png\",\"width\":920,\"height\":440,\"caption\":\"StudySection\"},\"image\":{\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/studysection\",\"https:\/\/twitter.com\/studysection\",\"https:\/\/www.instagram.com\/study.section\/\",\"https:\/\/www.linkedin.com\/company\/studysection\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402\",\"name\":\"admin-studysection-blog\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/studysection.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g\",\"caption\":\"admin-studysection-blog\"},\"url\":\"https:\/\/studysection.com\/blog\/author\/admin-studysection-blog\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"StudySection Blog - Common Exceptions in Selenium","description":"The exception object contains a lot of debugging information such as method name, line number where the exception occurred and type of exception.","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:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/","og_locale":"en_US","og_type":"article","og_title":"StudySection Blog - Common Exceptions in Selenium","og_description":"The exception object contains a lot of debugging information such as method name, line number where the exception occurred and type of exception.","og_url":"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/","og_site_name":"Blog Posts on famous people, innovations and educational topics","article_publisher":"https:\/\/www.facebook.com\/studysection","article_published_time":"2019-10-21T05:36:46+00:00","article_modified_time":"2019-10-21T13:17:02+00:00","og_image":[{"width":300,"height":200,"url":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2019\/10\/exceptions-in-selenium.jpg","type":"image\/jpeg"}],"author":"admin-studysection-blog","twitter_card":"summary_large_image","twitter_creator":"@studysection","twitter_site":"@studysection","twitter_misc":{"Written by":"admin-studysection-blog","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/#article","isPartOf":{"@id":"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/"},"author":{"name":"admin-studysection-blog","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402"},"headline":"Common Exceptions in Selenium","datePublished":"2019-10-21T05:36:46+00:00","dateModified":"2019-10-21T13:17:02+00:00","mainEntityOfPage":{"@id":"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/"},"wordCount":446,"commentCount":0,"publisher":{"@id":"https:\/\/studysection.com\/blog\/#organization"},"keywords":["Common Exceptions","exception handling in selenium","exceptions in selenium","selenium exceptions"],"articleSection":["Learn and Grow"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/","url":"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/","name":"StudySection Blog - Common Exceptions in Selenium","isPartOf":{"@id":"https:\/\/studysection.com\/blog\/#website"},"datePublished":"2019-10-21T05:36:46+00:00","dateModified":"2019-10-21T13:17:02+00:00","description":"The exception object contains a lot of debugging information such as method name, line number where the exception occurred and type of exception.","breadcrumb":{"@id":"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/studysection.com\/blog\/common-exceptions-in-selenium\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/studysection.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Common Exceptions in Selenium"}]},{"@type":"WebSite","@id":"https:\/\/studysection.com\/blog\/#website","url":"https:\/\/studysection.com\/blog\/","name":"Blog Posts on famous people, innovations and educational topics","description":"","publisher":{"@id":"https:\/\/studysection.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/studysection.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/studysection.com\/blog\/#organization","name":"StudySection","url":"https:\/\/studysection.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png","contentUrl":"https:\/\/studysection.com\/blog\/wp-content\/uploads\/2021\/10\/studySection-logo.png","width":920,"height":440,"caption":"StudySection"},"image":{"@id":"https:\/\/studysection.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/studysection","https:\/\/twitter.com\/studysection","https:\/\/www.instagram.com\/study.section\/","https:\/\/www.linkedin.com\/company\/studysection"]},{"@type":"Person","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/db367e2c29a12d1808fb1979edb3d402","name":"admin-studysection-blog","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/studysection.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/054ac87a6874df1932004239cd8eab36?s=96&d=mm&r=g","caption":"admin-studysection-blog"},"url":"https:\/\/studysection.com\/blog\/author\/admin-studysection-blog\/"}]}},"views":271,"_links":{"self":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/1322"}],"collection":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/comments?post=1322"}],"version-history":[{"count":13,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/1322\/revisions"}],"predecessor-version":[{"id":1337,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/posts\/1322\/revisions\/1337"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/media\/1323"}],"wp:attachment":[{"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/media?parent=1322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/categories?post=1322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/studysection.com\/blog\/wp-json\/wp\/v2\/tags?post=1322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}