{"id":113941,"date":"2018-02-27T06:42:55","date_gmt":"2018-02-27T06:42:55","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=113941"},"modified":"2021-07-16T11:37:43","modified_gmt":"2021-07-16T11:37:43","slug":"how-to-implement-cucumber-with-selenium","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/","title":{"rendered":"How to Implement Cucumber with selenium"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Introduction<\/h3>\n\n\n\n<p>Cucumber is a BDD testing framework that helps to understand the gap between software developers and business developers, we can use this to implement <em>BDD<\/em> approach with Selenium.<\/p>\n\n\n\n<p>BDD stands for <strong><em>Behaviour driven development<\/em><\/strong>\u2013 BDD mainly deals with the behaviour of the application, we only focus on the behaviour of the application developed. In BDD, all the requirements are written in simple english language, which is very easy to understand for all.<\/p>\n\n\n\n<p>Cucumber uses <strong><em>Gherkin keywords <\/em><\/strong>that are very easy to understand and tells the flow of the tests. Gherkin keywords are used in <em><strong>feature files <\/strong><\/em>to write the test flow in simple and efficient way.<\/p>\n\n\n\n<p>List of jar files required for cucmber:-<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>cucumber-core<\/li><li>cucumber-java<\/li><li>cucumber-junit<\/li><li>cucumber-jvm-deps<\/li><li>cucumber-reporting<\/li><li>gherkin<\/li><li>junit<\/li><li>mockito-all<\/li><li>cobertura<\/li><\/ol>\n\n\n\n\n<h3>Gherkin Keywords<\/h3>\n\n\n\n\n<p><span>Gherkin is a simple readable language that cucumber understands and describes the application flow in terms of simple steps. <em>In cucumber, each line starts with a gherkin keyword.<br>Some of the Gherkin keywords available in Cucumber are:-<br><\/em><\/span><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Feature<\/li><li>Scenario<\/li><li>Given<\/li><li>When,Then,And,But<\/li><li>Background<\/li><li>Scenario Outline<\/li><li>Examples<\/li><\/ul>\n\n\n\n<div class=\"wk-index-wrap\"><h3 class=\"index-title\">Feature File<\/h3><\/div><div class=\"margin-bottom-50\">\n<p>A feature file contains the steps in which the test execution flow is defined. A feature file has <em><strong> .feature <\/strong><\/em><em> file extension.<\/em><\/p>\n\n\n\n<p>for instance, let&#8217;s consider the file name to be <em><strong>My_feature_file <\/strong><\/em><em>in that case, user needs to save the feature file as <\/em><em><strong>My_feature_file.feature<\/strong><\/em><\/p>\n\n\n\n<p><strong>Feature File example:-<\/strong><\/p>\n\n\n\n<p>Feature file to test the login functionality of a login page.\n@smokeTest\nFeature: To test the login functionality\n\nScenario: Test login with valid credentials\nGiven Open Firefox and navigate to Login page\nWhen valid Email ID and password is entered\nThen user should logged in successfully\n\n<\/p>\n<\/div>\n\n\n\n<p>This was the basic concept of BDD through cucumber, in our next blog, we will focus on the parametrization concept in cucumber.<\/p>\n\n\n\n<p>Please share your valuable feedback in the comment section below, Keep Testing!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Cucumber is a BDD testing framework that helps to understand the gap between software developers and business developers, we can use this to implement BDD approach with Selenium. BDD stands for Behaviour driven development\u2013 BDD mainly deals with the behaviour of the application, we only focus on the behaviour of the application developed. In <a href=\"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":180,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3137,4932],"tags":[],"class_list":["post-113941","post","type-post","status-publish","format-standard","hentry","category-testing","category-web-testing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to implement cucumber with selenium | Cucumber | Gherkin | BDD<\/title>\n<meta name=\"description\" content=\"BDD stands for Behavior driven development\u2013 BDD mainly deals with the behavior of the application, we only focus on the behavior of the application developed\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to implement cucumber with selenium | Cucumber | Gherkin | BDD\" \/>\n<meta property=\"og:description\" content=\"BDD stands for Behavior driven development\u2013 BDD mainly deals with the behavior of the application, we only focus on the behavior of the application developed\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-02-27T06:42:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-16T11:37:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Rahul Upadhyay\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rahul Upadhyay\" \/>\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:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/\"},\"author\":{\"name\":\"Rahul Upadhyay\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/4e1d2bf0d14e7c6e80a97902e9982e3e\"},\"headline\":\"How to Implement Cucumber with selenium\",\"datePublished\":\"2018-02-27T06:42:55+00:00\",\"dateModified\":\"2021-07-16T11:37:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/\"},\"wordCount\":315,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"articleSection\":[\"Testing\",\"Web testing\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/\",\"name\":\"How to implement cucumber with selenium | Cucumber | Gherkin | BDD\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2018-02-27T06:42:55+00:00\",\"dateModified\":\"2021-07-16T11:37:43+00:00\",\"description\":\"BDD stands for Behavior driven development\u2013 BDD mainly deals with the behavior of the application, we only focus on the behavior of the application developed\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Implement Cucumber with selenium\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/4e1d2bf0d14e7c6e80a97902e9982e3e\",\"name\":\"Rahul Upadhyay\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ec3e4b9e8fc4bf599e04086b0c15093211ef33767ae4c07a6c63169735efbd1e?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ec3e4b9e8fc4bf599e04086b0c15093211ef33767ae4c07a6c63169735efbd1e?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Rahul Upadhyay\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/rahulkumar-upadhyay671\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to implement cucumber with selenium | Cucumber | Gherkin | BDD","description":"BDD stands for Behavior driven development\u2013 BDD mainly deals with the behavior of the application, we only focus on the behavior of the application developed","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:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/","og_locale":"en_US","og_type":"article","og_title":"How to implement cucumber with selenium | Cucumber | Gherkin | BDD","og_description":"BDD stands for Behavior driven development\u2013 BDD mainly deals with the behavior of the application, we only focus on the behavior of the application developed","og_url":"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2018-02-27T06:42:55+00:00","article_modified_time":"2021-07-16T11:37:43+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Rahul Upadhyay","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Rahul Upadhyay","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/"},"author":{"name":"Rahul Upadhyay","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/4e1d2bf0d14e7c6e80a97902e9982e3e"},"headline":"How to Implement Cucumber with selenium","datePublished":"2018-02-27T06:42:55+00:00","dateModified":"2021-07-16T11:37:43+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/"},"wordCount":315,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"articleSection":["Testing","Web testing"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/","url":"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/","name":"How to implement cucumber with selenium | Cucumber | Gherkin | BDD","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2018-02-27T06:42:55+00:00","dateModified":"2021-07-16T11:37:43+00:00","description":"BDD stands for Behavior driven development\u2013 BDD mainly deals with the behavior of the application, we only focus on the behavior of the application developed","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-implement-cucumber-with-selenium\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Implement Cucumber with selenium"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/4e1d2bf0d14e7c6e80a97902e9982e3e","name":"Rahul Upadhyay","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ec3e4b9e8fc4bf599e04086b0c15093211ef33767ae4c07a6c63169735efbd1e?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ec3e4b9e8fc4bf599e04086b0c15093211ef33767ae4c07a6c63169735efbd1e?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Rahul Upadhyay"},"url":"https:\/\/webkul.com\/blog\/author\/rahulkumar-upadhyay671\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/113941","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/180"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=113941"}],"version-history":[{"count":39,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/113941\/revisions"}],"predecessor-version":[{"id":296463,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/113941\/revisions\/296463"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=113941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=113941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=113941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}