{"id":1498,"date":"2022-01-06T19:02:15","date_gmt":"2022-01-06T19:02:15","guid":{"rendered":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/2022\/01\/06\/cucumber-nterview-questions\/"},"modified":"2022-01-06T19:02:15","modified_gmt":"2022-01-06T19:02:15","slug":"cucumber-nterview-questions","status":"publish","type":"post","link":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/2022\/01\/06\/cucumber-nterview-questions\/","title":{"rendered":"Cucumber Interview Questions"},"content":{"rendered":"<p><html><body><\/p>\n<section class=\"tcb-post-content tcb-shortcode thrv_wrapper\" data-css=\"tve-u-16ec5d248bb\">\n<div class=\"tve_flt tcb-style-wrap\" id=\"tve_flt\">\n<div class=\"tve_shortcode_editor tar-main-content\" data-post-id=\"1498\" id=\"tve_editor\">\n<div class=\"thrv_wrapper tve-toc tve-elem-scroll tve-toc-expandable tcb-local-vars-root\" data-animation=\"slide\" data-animation-speed=\"fast\" data-bullet-style='{\"0\":\"tve-u-61d73cb75a1911\",\"1\":\"tve-u-61d73cb75a1922\",\"2\":\"tve-u-61d73cb75a1936\"}' data-columns=\"1\" data-columns-d=\"1\" data-css=\"tve-u-17e30c924ba\" data-ct=\"toc-60671\" data-ct-name=\"Table of Contents 03\" data-element-name=\"Table of Contents\" data-headers=\"h1,h3,h5\" data-heading-style='{\"0\":\"tve-u-61d73cb75a1838\",\"1\":\"tve-u-17e30c924d4\",\"2\":\"tve-u-61d73cb75a18e2\"}' data-highlight=\"section\" data-number-style='{\"0\":\"tve-u-61d73cb75a1943\",\"1\":\"tve-u-61d73cb75a1957\",\"2\":\"tve-u-61d73cb75a1974\"}' data-numbering=\"basic\" data-state-default=\"expanded\" data-state-default-m=\"collapsed\" data-transition=\"fade\" style=\"\">\n<div class=\"thrive-colors-palette-config\" style=\"display: none !important\"><\/div>\n<div class=\"tve-toc-divider\" style=\"position: absolute; width: 0; height: 0; overflow: hidden;\">\n<div class=\"thrv_wrapper thrv-divider tve-vert-divider\" data-color-d=\"rgba(0, 0, 0, 0)\" data-css=\"tve-u-17e30c924c0\" data-style=\"tve_sep-1\" data-thickness-d=\"1\">\n<hr class=\"tve_sep tve_sep-1\" style=\"\"\/><\/div>\n<\/div>\n<p><svg class=\"toc-icons\" style=\"position: absolute; width: 0; height: 0; overflow: hidden;\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><symbol data-id=\"icon-circle-outlined\" id=\"toc-bullet-0\" viewbox=\"0 0 512 512\"><path d=\"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z\"><\/path><\/symbol><symbol data-id=\"icon-circle-outlined\" id=\"toc-bullet-1\" viewbox=\"0 0 512 512\"><path d=\"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z\"><\/path><\/symbol><symbol data-id=\"icon-circle-outlined\" id=\"toc-bullet-2\" viewbox=\"0 0 512 512\"><path d=\"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z\"><\/path><\/symbol><\/svg><\/p>\n<div class=\"tve-content-box-background\" data-css=\"tve-u-17e30c924c7\" style=\"\"><\/div>\n<div class=\"thrv_wrapper tve-toc-title show-icon tcb-icon-display tve-no-dropzone tve-prevent-content-edit\" data-css=\"tve-u-17e30c924cb\" style=\"\">\n<div class=\"tve-content-box-background\"><\/div>\n<div class=\"tve-cb\" style=\"\">\n<div class=\"tve-toc-title-icon\" data-icon-code=\"icon-arrow-circle-down-solid\" style=\"\"><svg class=\"tcb-icon\" data-id=\"icon-arrow-circle-down-solid\" data-name=\"\" viewbox=\"0 0 512 512\"><path d=\"M504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-143.6-28.9L288 302.6V120c0-13.3-10.7-24-24-24h-16c-13.3 0-24 10.7-24 24v182.6l-72.4-75.5c-9.3-9.7-24.8-9.9-34.3-.4l-10.9 11c-9.4 9.4-9.4 24.6 0 33.9L239 404.3c9.4 9.4 24.6 9.4 33.9 0l132.7-132.7c9.4-9.4 9.4-24.6 0-33.9l-10.9-11c-9.5-9.5-25-9.3-34.3.4z\"><\/path><\/svg><\/div>\n<div class=\"thrv_wrapper thrv_text_element tve_no_icons\">\n<div class=\"tcb-plain-text\" style=\"\">Table of Contents<\/div>\n<\/p><\/div>\n<\/div>\n<\/div>\n<div class=\"tve-cb tve-toc-content tve-prevent-content-edit\" style=\"\">\n<div class=\"thrv_wrapper tve-toc-list tcb-no-delete tcb-no-save tcb-no-clone tve-no-dropzone\" data-css=\"tve-u-17e30c924d0\" style=\"\">\n<div class=\"tve-content-box-background\"><\/div>\n<div class=\"tve-cb\" style=\"\">\n<div class=\"tve_ct_content tve_clearfix\" style=\"\">\n<div class=\"ct_column\">\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939482\" jump-animation=\"smooth\">1. What is Cucumber?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939483\" jump-animation=\"smooth\">2. What is Gherkin language?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939484\" jump-animation=\"smooth\">3. What do you meant by a feature file?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939485\" jump-animation=\"smooth\">4. What is Step definition?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939486\" jump-animation=\"smooth\">5. What do you mean by Scenario and Scenario Outline?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939487\" jump-animation=\"smooth\">6. Different keywords used in Cucumber to write a scenario? <\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939488\" jump-animation=\"smooth\">7. What is the meaning of Test Runner class file?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939489\" jump-animation=\"smooth\">8. Which are the 2 annotations used within TestRunner class file?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939490\" jump-animation=\"smooth\">9. Different properties supported by CucumberOptions?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939491\" jump-animation=\"smooth\">10. What is Datatable in Cucumber?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939492\" jump-animation=\"smooth\">11. What is the use of Background keyword in Cucumber?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939493\" jump-animation=\"smooth\">12. What are cucumber tags and where we use them?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939494\" jump-animation=\"smooth\">13. What are Hooks?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939495\" jump-animation=\"smooth\">14. Different Hooks in Cucumber.<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939496\" jump-animation=\"smooth\">15. What is Cucumber expression and different parameter types used with Cucumber expression?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939497\" jump-animation=\"smooth\">16. What is dry run in Cucumber?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939498\" jump-animation=\"smooth\">17. What is monochrome option in Cucumber?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939499\" jump-animation=\"smooth\">18. Reporting in Cucumber?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939500\" jump-animation=\"smooth\">19. What is strict option in Cucumber?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939501\" jump-animation=\"smooth\">20. What are the advantages of using Cucumber?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939502\" jump-animation=\"smooth\">21. What is the purpose of Glue parameter within CucumberOptions annotation? <\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939503\" jump-animation=\"smooth\">22. What is BDD and how Cucumber complies with BDD?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939504\" jump-animation=\"smooth\">23. Explain the test harness?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939505\" jump-animation=\"smooth\">24. Name any 2 testing fraemwork that can be integrated with Cucumber?<\/a><\/div>\n<div class=\"thrv_wrapper tve-toc-heading tve-toc-heading-level1 tve_no_icons\" data-css=\"tve-u-17e30c924d4\" data-element-name=\"Heading Level 2\" data-tag=\"H3\"><a class=\"tve-toc-anchor tve-jump-scroll\" href=\"#t-1638970939506\" jump-animation=\"smooth\">25. Name any 2 build management tools that can be integrated with Cucumber?<\/a><\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv-divider tve-vert-divider\" data-color-d=\"rgba(0, 0, 0, 0)\" data-css=\"tve-u-17e30c924c0\" data-style=\"tve_sep-1\" data-thickness-d=\"1\">\n<hr class=\"tve_sep tve_sep-1\" style=\"\"\/><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 class=\"\" data-alt-text=\"1. What is Cucumber?\" id=\"t-1638970939482\"><b>1. What is Cucumber?<\/b><\/h3>\n<ul class=\"\">\n<li>Cucumber is a testing tool based on BDD(Behavior Driven Development) framework.<\/li>\n<li>Cucumber reads executable specifications written in plain text and validates if the software is able to follow those specifications.<\/li>\n<li>In simple terms, cucumber help Software tester to develop test cases in plain text to validate software behavior.<\/li>\n<\/ul>\n<h3 class=\"\" data-alt-text=\"2. What is Gherkin language?\" id=\"t-1638970939483\"><b>2. What is Gherkin language?<\/b><\/h3>\n<ul class=\"\">\n<li>Gherkin is a plain\/simple English language used to define application\/software behavior.<\/li>\n<li>It&#8217;s a domain-specific language for defining specs tests in Cucumber format.<\/li>\n<li>Gherkin serves multiple purposes: Automated testing using Cucumber, Document how the system actually behaves.<\/li>\n<\/ul>\n<h3 class=\"\" data-alt-text=\"3. What do you meant by a feature file?\" id=\"t-1638970939484\"><b>3. What do you meant by a feature file?<\/b><\/h3>\n<ul class=\"\">\n<li>A feature file must provide a high-level description of an Application Under Test (AUT).<\/li>\n<li>\u00a0The first line of the feature file must start with the keyword &#8216;Feature&#8217; followed by the description of the application under test.<\/li>\n<li>For each feature under test, it is recommended that a separate feature file should be created. The feature file must have the extension &#8220;.feature.&#8221;<b> <\/b><\/li>\n<\/ul>\n<p><b> <\/b><\/p>\n<div class=\"code-block code-block-2\" style=\"margin: 8px auto; text-align: center; display: block; clear: both;\">\n<p><!-- horizontal responsive 2 --><br \/>\n<ins class=\"adsbygoogle\" data-ad-client=\"ca-pub-3231318496783163\" data-ad-format=\"auto\" data-ad-slot=\"2788468763\" data-full-width-responsive=\"true\" style=\"display:block\"><\/ins>\n<\/div>\n<h3 class=\"\" data-alt-text=\"4. What is Step definition?\" id=\"t-1638970939485\"><b>4. What is Step definition?<\/b><\/h3>\n<ul class=\"\">\n<li>Step Definition is a method\/function\/block with an expression that links it to one or more Gherkin steps. When Cucumber executes a Gherkin step in a scenario, it will look for a matching step definition to execute.<\/li>\n<\/ul>\n<\/div>\n<div class=\"thrv_wrapper tve_image_caption\" data-css=\"tve-u-17e30d72563\" style=\"\"><span class=\"tve_image_frame\"><img alt=\"\" class=\"tve_image wp-image-1458 tcb-moved-image\" data-css=\"tve-u-17e30d730cb\" data-height=\"85\" data-id=\"1458\" data-init-height=\"163\" data-init-width=\"997\" data-width=\"517\" decoding=\"async\" height=\"85\" loading=\"lazy\" src=\"\/blog\/wp-content\/uploads\/2022\/01\/Stepdefinition.png\" style=\"\" title=\"Stepdefinition\" width=\"517\"\/><\/span><\/div>\n<div class=\"thrv_wrapper thrv_text_element\">\n<h3 class=\"\" data-alt-text=\"5. What do you mean by Scenario and Scenario Outline?\" id=\"t-1638970939486\"><b>5. What do you mean by Scenario and Scenario Outline?<\/b><\/h3>\n<ul class=\"\">\n<li><strong><u>Scenario<\/u> <\/strong>is a fundamental Gherkin structure. Every scenario begins with the keyword &#8220;Scenario:&#8221; and ends with a scenario title. Every feature file can have one or more scenarios, each of which has one or more steps.<br \/><strong><i>Scenario<\/i><\/strong>: Sunday isn&#8217;t Friday<br \/>\u00a0\u00a0\u00a0 Given today is Sunday<br \/>\u00a0\u00a0\u00a0 When I ask whether it&#8217;s Friday yet<br \/>\u00a0 \u00a0 Then I should be told &#8220;Nope&#8221;<\/li>\n<li>\u00a0<strong><u>Scenario Outline<\/u><\/strong> is a way to parameterize the scenarios. This is ideally used when the same scenario needs to be executed for multiple sets of data. Scenario Outline must be followed by the keyword \u2018Examples\u2019, which specify the set of values for each parameter. <br \/><strong><i>Scenario Outline<\/i>:<\/strong> eating<br \/>\u00a0 Given there are &lt;start&gt; cucumbers<br \/>\u00a0 When I eat &lt;eat&gt; cucumbers<br \/>\u00a0 Then I should have &lt;left&gt; cucumbers<br \/>\u00a0 <i>Examples:<\/i><br \/>\u00a0\u00a0\u00a0 | start | eat | left |<br \/>\u00a0\u00a0\u00a0 |\u00a0\u00a0\u00a0 12 |\u00a0\u00a0 5 |\u00a0\u00a0\u00a0 7 |<br \/>\u00a0 \u00a0 | \u00a0 \u00a020 | \u00a0 5 | \u00a0 15 |<\/li>\n<\/ul>\n<h3 class=\"\" data-alt-text=\"6. Different keywords used in Cucumber to write a scenario? \" id=\"t-1638970939487\">6. Different keywords used in Cucumber to write a scenario?<\/h3>\n<ul class=\"\">\n<li class=\"\">Given: Pre Condition<\/li>\n<li class=\"\">When: User Actions<\/li>\n<li class=\"\">Then: Expected Output<\/li>\n<li class=\"\">And: Multiple user actions with positive statements<\/li>\n<li class=\"\">But: Multiple user actions with negative statements<\/li>\n<\/ul>\n<h3 class=\"\" data-alt-text=\"7. What is the meaning of Test Runner class file?\" id=\"t-1638970939488\"><b>7. What is the meaning of Test Runner class file?<\/b><\/h3>\n<ul class=\"\">\n<li>It is used to bind Feature and Step definition file. With the help of Test Runner file we can control and manipulate execution as per requirement.<b> <\/b><\/li>\n<\/ul>\n<h3 class=\"\" data-alt-text=\"8. Which are the 2 annotations used within TestRunner class file?\" id=\"t-1638970939489\"><b>8. Which are the 2 annotations used within TestRunner class file?<\/b><\/h3>\n<ul class=\"\">\n<li>@RunWith: It tells JUnit that tests should run using Cucumber class present in &#8216;Cucumber.api<\/li>\n<li>@CucumberOptions: It can be used to provide additional configuration to the runner. This annotation tells Cucumber a lot of things like where to look for feature files, what reporting system to use etc.<\/li>\n<\/ul>\n<h3 class=\"\" data-alt-text=\"9. Different properties supported by CucumberOptions?\" id=\"t-1638970939490\"><b>9. Different properties supported by CucumberOptions?<\/b><\/h3>\n<p>-cucumber.ansi-colors.disabled<br \/>-cucumber.execution.dry-run<br \/>-cucumber.execution.limit<br \/>-cucumber.execution.order<br \/>-cucumber.execution.strict<br \/>-cucumber.execution.wip<br \/>-cucumber.features<br \/>-cucumber.filter.name<br \/>-cucumber.filter.tags<br \/>-cucumber.glue<br \/>-cucumber.plugin<br \/>-cucumber.object-factory<br \/>-cucumber.snippet-type<\/p>\n<h3 class=\"\" data-alt-text=\"10. What is Datatable in Cucumber?\" id=\"t-1638970939491\"><b>10. What is Datatable in Cucumber?<\/b><\/h3>\n<p>&#8211; Data Tables are handy for passing a list of values to a step definition. Cucumber provides a rich API for manipulating tables from within step definitions. Data Tables are also used to handle large amount of data. Tables in Cucumber feature files are represented by using the pipeline \u201c|\u201d sign.<\/p>\n<p>We can use data table under scenario OR scenario Outline.<\/p>\n<p>Possible ways to convert DataTable:<br \/>asMaps()<br \/>asLists()<br \/>asList()<br \/>asMap()<\/p>\n<h3 class=\"\" data-alt-text=\"11. What is the use of Background keyword in Cucumber?\" id=\"t-1638970939492\"><b>11. What is the use of Background keyword in Cucumber?<\/b><\/h3>\n<p>-Background keyword is used to group multiple given statements into a single group. This is generally used when the same set of given statements are repeated in each scenario of the feature file. A Background is placed before the first Scenario\/Example, at the same level of indentation.<\/p>\n<p><i>Feature<\/i>: Multiple site support<br \/>\u00a0 \u00a0Only blog owners can post to a blog, except administrators,<br \/>\u00a0 \u00a0who can post to all blogs.<\/p>\n<p><i>Background<\/i><i>:<\/i><br \/>\u00a0 \u00a0 Given a global administrator named &#8220;Greg&#8221;<br \/>\u00a0 \u00a0 And a blog named &#8220;Greg&#8217;s anti-tax rants&#8221;<br \/>\u00a0 \u00a0 And a customer named &#8220;Dr. Bill&#8221;<br \/>\u00a0 \u00a0 And a blog named &#8220;Expensive Therapy&#8221; owned by &#8220;Dr. Bill&#8221;<\/p>\n<p><i>Scenario<\/i>: Dr. Bill posts to his own blog<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Given I am logged in as Dr. Bill<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 When I try to post to &#8220;Expensive Therapy&#8221;<br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Then I should see &#8220;Your article was published.&#8221;<\/p>\n<h3 class=\"\" data-alt-text=\"12. What are cucumber tags and where we use them?\" id=\"t-1638970939493\"><b>12. What are cucumber tags and where we use them?<\/b><\/h3>\n<p>-Tags are a great way to organize your features and scenarios. It also help in filtering the scenarios. We can group the scenarios using tags and then run them based on tags. It can be tagged with Feature, Scenario, Scenario outline and Examples using @ symbol.<\/p>\n<p>@billing<br \/><i>Feature<\/i>: Verify billing<\/p>\n<p>@important<br \/><i>Scenario<\/i>: Missing product description<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Given hello<\/p>\n<p>@Compatibility<br \/><i>Scenario Outline: <\/i>Steps will run conditionally if tagged<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Given user is logged in<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 When user clicks &lt;link&gt;<br \/>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Then user will be logged out<\/p>\n<p>@mobile<br \/><i>Examples<\/i>:<br \/>| link\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|<br \/>| logout link on mobile |<\/p>\n<p>@desktop<br \/><i>Examples<\/i>:<br \/>| link\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|<br \/>| logout link on desktop |<\/p>\n<h3 class=\"\" data-alt-text=\"13. What are Hooks?\" id=\"t-1638970939494\"><b>13. What are Hooks?<\/b><\/h3>\n<p>-Hooks are blocks of code that can run at various points in the Cucumber execution cycle. They are typically used for setup and teardown of the environment before and after each scenario.<\/p>\n<h3 class=\"\" data-alt-text=\"14. Different Hooks in Cucumber.\" id=\"t-1638970939495\"><b>14. Different Hooks in Cucumber.<\/b><\/h3>\n<p>&#8211; <i>Scenario Hooks<\/i>: Run for every scenarios.<br \/>Two types of Scenario hooks,<br \/><i>-Before Hook: <\/i>Run before the first step of each scenario<br \/><i>@Before<\/i><br \/>public void doSomethingBefore() {<br \/>}<br \/><i>-After Hooks<\/i>: Run after the last step of each scenario, even when the step result is failed, undefined, pending, or skipped.<\/p>\n<p><i>@After<\/i><br \/>public void doSomethingAfter(Scenario scenario){<br \/>}<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -Step Hooks: Run for every steps.<\/p>\n<p>Two types of Step hooks,<br \/>-BeforeStep Hook: Run before each step.<br \/>@<i>BeforeStep<\/i><br \/>public void doSomethingBeforeStep(Scenario scenario){<br \/>}<br \/>-AfterStep Hook: Run after each step.<br \/>@<i>AfterStep<\/i><br \/>public void doSomethingAfterStep(Scenario scenario){<br \/>}<\/p>\n<h3 class=\"\" data-alt-text=\"15. What is Cucumber expression and different parameter types used with Cucumber expression?\" id=\"t-1638970939496\"><b>15. What is Cucumber expression and different parameter types used with Cucumber expression?<\/b><\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -Cucumber Expressions is an alternative to Regular Expressions with a more intuitive syntax. Cucumber supports both Cucumber Expressions and Regular Expressions for defining Step Definitions, but you cannot mix Cucumber Expression syntax with Regular Expression syntax in the same expression.<\/p>\n<p><i>Parameter types<\/i>:<br \/>{int}, {float}, {word}, {string}, {} anonymous<br \/>{int}: <br \/>I have 42 cucumbers in my belly<br \/>I have {int} cucumbers in my belly<\/p>\n<p>{float}:<br \/>I have 42.5 cucumbers in my belly<br \/>I have {float} cucumbers in my belly<\/p>\n<p>{word}:<br \/>I have a red ball<br \/>I have a {color} ball<\/p>\n<p> {string}: Matches single-quoted or double-quoted strings<\/p>\n<p>&#8220;banana split&#8221; or &#8216;banana split&#8217;<\/p>\n<p><\/p>\n<h3 class=\"\" data-alt-text=\"16. What is dry run in Cucumber?\" id=\"t-1638970939497\"><b>16. What is dry run in Cucumber?<\/b><\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 -Dry run is to verify whether all feature file steps have corresponding step definitions. The value of dry run can be either true or false. The default value of dry run is false and it is a part of the Test Runner Class file.<\/p>\n<p>package com.example;<br \/>import io.cucumber.junit.Cucumber;<br \/>import io.cucumber.junit.CucumberOptions;<br \/>import org.junit.runner.RunWith;<\/p>\n<p>@RunWith(Cucumber.class)<br \/>@CucumberOptions(dryRun=true)<br \/>public class RunCucumberTest {<br \/>}<br \/><!--[if !supportLineBreakNewLine]--><\/p>\n<h3 class=\"\" data-alt-text=\"17. What is monochrome option in Cucumber?\" id=\"t-1638970939498\"><b>17. What is monochrome option in Cucumber?<\/b><\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8211; It is used to display output in the console in readable format. It basically takes 2 values(true and false), dafulat value is false. if the monochrome is set to,<br \/><u>true:<\/u> then the console output for the Cucumber test are much more readable and remove any unreadable character. <br \/><u>false<\/u>: then the console output is not as readable as it should be.<\/p>\n<h3 class=\"\" data-alt-text=\"18. Reporting in Cucumber?\" id=\"t-1638970939499\"><b>18. Reporting in Cucumber?<\/b><\/h3>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0&#8211; Cucumber uses reporter plugins to produce reports that contain information about what scenarios have passed or failed. The easiest way to get started with reporting is to use the Cucumber Reports service. Publishing to the Cucumber Reports service is currently supported in:<br \/>Cucumber-JVM 6.7.0 and above<br \/>Cucumber-Ruby 5.1.1 and above<br \/>Cucumber-JS 7.0.0 and above<\/p>\n<h3 class=\"\" data-alt-text=\"19. What is strict option in Cucumber?\" id=\"t-1638970939500\"><b>19. What is strict option in Cucumber?<\/b><\/h3>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8211; Strict is used to identify undefined steps from execution. By default it is set to true.\u00a0 if the strict is set to,<br \/><u>false<\/u>: At execution time if cucumber encounters any undefined\/pending steps then cucumber does not fail the execution and undefined steps are skipped and BUILD is SUCCESSFUL.<br \/><u>true<\/u>: At execution time if cucumber encounters any undefined\/pending steps then cucumber does fails the execution and undefined steps are marked as fail and BUILD is FAILURE<\/p>\n<h3 class=\"\" data-alt-text=\"20. What are the advantages of using Cucumber?\" id=\"t-1638970939501\"><b>20. What are the advantages of using Cucumber?<\/b><\/h3>\n<ul class=\"\">\n<li>Cucumber is an open-source and free-to-use tool.<\/li>\n<li>Cucumber supports a variety of programming languages, including Java.net and Ruby.<\/li>\n<li>It serves as a link between commercial and technical language. This can be done by writing a test case in plain English text<\/li>\n<li>You can involve business stakeholders who cannot code.<\/li>\n<li>Code reusability.<\/li>\n<\/ul>\n<h3 class=\"\" data-alt-text=\"21. What is the purpose of Glue parameter within CucumberOptions annotation? \" id=\"t-1638970939502\"><b>21. What is the purpose of Glue parameter within CucumberOptions annotation? <br \/><!--[if !supportLineBreakNewLine]--><br \/><\/b><\/h3>\n<ul class=\"\">\n<li>The glue parameter is used to specify the path of the step definition file.<\/li>\n<\/ul>\n<h3 class=\"\" data-alt-text=\"22. What is BDD and how Cucumber complies with BDD?\" id=\"t-1638970939503\">22. What is BDD and how Cucumber complies with BDD?<\/h3>\n<p>\u00a0 \u00a0 \u00a0-BDD is a Behavior Driven Development approach of the software development process where Cucumber works in BDD way of approach. The tests in BDD are written in a human-readable format and understandable which are easier to implement. The BDD tests are non-programming and easier to write. The Behavior Driven Development process is highly efficient and useful in resolving complex solutions and requirements in the project to handle smoothly.<\/p>\n<h3 class=\"\" data-alt-text=\"23. Explain the test harness?\" id=\"t-1638970939504\">23. Explain the test harness?<\/h3>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 -A test harness for Cucumber and RSpec enables a separate responsibility between the context setup and interacting with the browser cleaning up the step definition files.<\/p>\n<h3 class=\"\" data-alt-text=\"24. Name any 2 testing fraemwork that can be integrated with Cucumber?\" id=\"t-1638970939505\">24. Name any 2 testing framework that can be integrated with Cucumber?<\/h3>\n<ul class=\"\">\n<li class=\"\">TestNG<\/li>\n<li class=\"\">JUnit<\/li>\n<\/ul>\n<h3 class=\"\" data-alt-text=\"25. Name any 2 build management tools that can be integrated with Cucumber?\" id=\"t-1638970939506\">25. Name any 2 build management tools that can be integrated with Cucumber?<\/h3>\n<ul class=\"\">\n<li class=\"\">Gradle<\/li>\n<li class=\"\">Maven<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"tcb_flag\" style=\"display: none\"><\/div>\n<\/section>\n<p><\/body><\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Table of Contents 1. What is Cucumber? 2. What is Gherkin language? 3. What do you meant by a feature file? 4. What is Step definition? 5. What do you mean by Scenario and Scenario Outline? 6. Different keywords used in Cucumber to write a scenario? 7. What is the meaning of Test Runner class [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,4],"tags":[],"class_list":["post-1498","post","type-post","status-publish","format-standard","hentry","category-cucumber","category-interview-questions","post-wrapper","thrv_wrapper"],"_links":{"self":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1498"}],"version-history":[{"count":0,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1498\/revisions"}],"wp:attachment":[{"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rahulshettyacademy.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}