{"id":71379,"date":"2020-01-10T11:21:59","date_gmt":"2020-01-10T05:51:59","guid":{"rendered":"https:\/\/www.vskills.in\/certification\/tutorial\/?p=71379"},"modified":"2024-04-12T14:13:40","modified_gmt":"2024-04-12T08:43:40","slug":"understanding-debugging","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/","title":{"rendered":"Understanding Debugging"},"content":{"rendered":"<h1><strong>Understanding Debugging<\/strong><\/h1>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/cdn.lynda.com\/course\/645067\/645067-637081444918667146-16x9.jpg\" alt=\"Understanding Debugging\" width=\"572\" height=\"322\" \/><\/p>\n<p>Lets start by understanding debugging.<\/p>\n<p>But before this, let&#8217;s have a look at Capybara. So, Capybara provides developers to simulate a user on a web page as well as make assertions based on the content and environment of the page. It also offers an API to interact with the web page. Also,\u00a0 let&#8217;s check out DSL.<\/p>\n<h2><strong>DSL<\/strong><\/h2>\n<p>DSL stands for Digital Subscriber Line. Moreover, users get a high-speed bandwidth connection from a phone wall jack on an existing telephone network. Not to mention, it also works within the frequencies that the telephone doesn\u2019t so you can use the Internet while making phone calls. Nonetheless, DSL utilizes telephone wires, which makes sense that the biggest providers are telephone companies.<\/p>\n<p>Now, let&#8217;s understand this section. It can be useful to take a snapshot of the page as it currently is and take a look at it:<\/p>\n<p>save_and_open_page<\/p>\n<p>You can also retrieve the current state of the DOM as a string using page.html.<\/p>\n<p>print page.html<\/p>\n<p>This is mostly useful for debugging. You should avoid testing against the contents of page.html and use the more expressive finder methods instead.<\/p>\n<p>Finally, in drivers that support it, you can save a screenshot:<\/p>\n<p>page.save_screenshot(&#8216;screenshot.png&#8217;)<\/p>\n<p>Or have it save and automatically open:<\/p>\n<p>save_and_open_screenshot<\/p>\n<p>The Capybara debugging methods can be summarized as<\/p>\n<p>save_and_open_page # saves current snapshot of page<\/p>\n<p>print page.html # retrieve current state of DOM<\/p>\n<p>save_sceenshot(&#8216;screenshot.png&#8217;) # save screenshot<\/p>\n<p>There is another method, which is more useful for debugging: the pry and pry-debugger gems. These gems will let you inspect script execution in an actual debugger, allowing you to set breakpoints, go next, step into, continue, etc. To use them, do the following:<\/p>\n<p>gem install pry-debugger (automatically installs pry as well)<\/p>\n<p>require &#8216;pry&#8217; in your test script or spec helper<\/p>\n<p>add binding.pry to the script to set a breakpoint and then, execute the test script. Execution will pause on the breakpoint. At this point, use next (to go to next line), step (to step into definition), continue (to continue execution) to debug as necessary.<\/p>\n<p>For more info about these gems check:<\/p>\n<p>* Pry<\/p>\n<p>* Pry-debugger<\/p>\n<p><strong>Make your resume stand out and become a Certified Capybara Testing Professional. <a href=\"https:\/\/www.vskills.in\/practice\/index.php?route=test\/search&amp;search=capybara\">So, Try free practice tests here!<\/a><\/strong><\/p>\n<p><strong>A great career is just a certification away. So, practice and validate your skills to become <a href=\"https:\/\/www.vskills.in\/certification\/testing\/capybara-testing-certification\">Certified Capybara Testing Professional<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Understanding Debugging Lets start by understanding debugging. But before this, let&#8217;s have a look at Capybara. So, Capybara provides developers to simulate a user on a web page as well as make assertions based on the content and environment of the page. It also offers an API to interact with the web page. Also,\u00a0 let&#8217;s&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[8248],"tags":[8280],"class_list":["post-71379","page","type-page","status-publish","hentry","category-capybara","tag-debugging"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Understanding Debugging - Vskills Tutorial<\/title>\n<meta name=\"description\" content=\"Enhance and Upgrade your Understanding Debugging skills for better career opportunities. Become a Certified Capybara Testing Professional Now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Understanding Debugging - Vskills Tutorial\" \/>\n<meta property=\"og:description\" content=\"Enhance and Upgrade your Understanding Debugging skills for better career opportunities. Become a Certified Capybara Testing Professional Now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vskills.in\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-12T08:43:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.lynda.com\/course\/645067\/645067-637081444918667146-16x9.jpg\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/\",\"name\":\"Understanding Debugging - Vskills Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdn.lynda.com\/course\/645067\/645067-637081444918667146-16x9.jpg\",\"datePublished\":\"2020-01-10T05:51:59+00:00\",\"dateModified\":\"2024-04-12T08:43:40+00:00\",\"description\":\"Enhance and Upgrade your Understanding Debugging skills for better career opportunities. Become a Certified Capybara Testing Professional Now!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/#primaryimage\",\"url\":\"https:\/\/cdn.lynda.com\/course\/645067\/645067-637081444918667146-16x9.jpg\",\"contentUrl\":\"https:\/\/cdn.lynda.com\/course\/645067\/645067-637081444918667146-16x9.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Understanding Debugging\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"name\":\"Tutorial\",\"description\":\"Vskills - A initiative in elearning and certification\",\"publisher\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\",\"name\":\"Vskills\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"width\":73,\"height\":55,\"caption\":\"Vskills\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vskills.in\/\",\"https:\/\/x.com\/vskills_in\",\"https:\/\/www.linkedin.com\/company-beta\/1371554\/\",\"https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Understanding Debugging - Vskills Tutorial","description":"Enhance and Upgrade your Understanding Debugging skills for better career opportunities. Become a Certified Capybara Testing Professional Now!","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:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/","og_locale":"en_US","og_type":"article","og_title":"Understanding Debugging - Vskills Tutorial","og_description":"Enhance and Upgrade your Understanding Debugging skills for better career opportunities. Become a Certified Capybara Testing Professional Now!","og_url":"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/","og_site_name":"Tutorial","article_publisher":"https:\/\/www.facebook.com\/vskills.in\/","article_modified_time":"2024-04-12T08:43:40+00:00","og_image":[{"url":"https:\/\/cdn.lynda.com\/course\/645067\/645067-637081444918667146-16x9.jpg","type":"","width":"","height":""}],"twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/","name":"Understanding Debugging - Vskills Tutorial","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/#primaryimage"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.lynda.com\/course\/645067\/645067-637081444918667146-16x9.jpg","datePublished":"2020-01-10T05:51:59+00:00","dateModified":"2024-04-12T08:43:40+00:00","description":"Enhance and Upgrade your Understanding Debugging skills for better career opportunities. Become a Certified Capybara Testing Professional Now!","breadcrumb":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/#primaryimage","url":"https:\/\/cdn.lynda.com\/course\/645067\/645067-637081444918667146-16x9.jpg","contentUrl":"https:\/\/cdn.lynda.com\/course\/645067\/645067-637081444918667146-16x9.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/understanding-debugging\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Understanding Debugging"}]},{"@type":"WebSite","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","name":"Tutorial","description":"Vskills - A initiative in elearning and certification","publisher":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization","name":"Vskills","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","width":73,"height":55,"caption":"Vskills"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vskills.in\/","https:\/\/x.com\/vskills_in","https:\/\/www.linkedin.com\/company-beta\/1371554\/","https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw"]}]}},"_links":{"self":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/71379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/comments?post=71379"}],"version-history":[{"count":6,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/71379\/revisions"}],"predecessor-version":[{"id":77983,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/71379\/revisions\/77983"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=71379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=71379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=71379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}