Selenium Cucumber Interview Questions & Answers

  1. Question 1. What Is A Test Framework?

    Answer :

    In general, a framework is an entity which binds several modules in a logical sequence to cover the end-to-end flows of an application. The objective of investing into a framework is to test a product which has a recurring roadmap and regular release cycle.

  2. Question 2. What Are The Apparent Advantages Of A Test Framework?

    Answer :

    Following are the possible benefits of using a test framework.

    1. It reduces the complexity of using a variety of technologies inculcated in a product.
    2. It organizes the unit and functional testing efforts of a developer and tester.
    3. Provides early feedback on the quality of the code.
    4. Helps in tracking test coverage as well as code coverage.
    5. Results in easy debugging and reduces chances of errors.
  3. WinRunner Interview Questions

  4. Question 3. What Type Of Tests Selenium Can Run?

    Answer :

    1. You can use Selenium for the functional, regression, and load testing of the web-based applications.
    2. You can employ this tool for doing the post-release validation.
    3. Integrate it with the continuous integration tools like Jenkins, Hudson, QuickBuild or CruiseControl.

    The above two questions were a little basic which sometimes we miss explaining during the interview. So, we thought it was worth starting with them.

  5. Question 4. What Are The Prereqs For Building A Selenium Cucumber Automation Framework?

    Answer :

    You might like to consider the following facts while creating a productive and scalable test framework.

    1. Identify the type of application you are going to test. Is it a Web app, support mobile devices or runs on a desktop.
    2. Would it require backend testing? e.g. Databases or SDK.
    3. Decide on the input format. Is it static or dynamic?
    4. Do you need to test the app for internationalization?
    5. It must have a report which can help you trace a failure with minimum efforts.
    6. It must support auto-generation of parametrization tests.
    7. Have a config file to define any setup related settings or the global properties.
    8. Apply abstraction at every level to separate the functionality.
  6. WinRunner Tutorial

  7. Question 5. List Down The Advantages Of Using Selenium As A Testing Tool?

    Answer :

    1. It’s an open source, so you save a lot on the cost side.
    2. It gives you options to choose from a list of programming languages. e.g. Java, Python, C-Sharp, Ruby, and Python.
    3. It offers easy and powerful dom-level testing.
    4. You can use it in either of Agile or waterfall environment.
    5. Easy integration with Jenkins, Bamboo, and some other notable CI tools.
  8. Adv Java Interview Questions

  9. Question 6. List Down The Mobile Device Which Selenium Supports?

    Answer :

    1. It supports Safari browser via a third-party driver. It is experimental and comes with limited functionality.
    2. It provides an Android driver to run tests on its native mobile browser.
  10. Question 7. Are There Any Readymade Selenium-cucumber Frameworks Available?

    Answer :

    Yes, there are a few we are listing down below. Though, we recommend building one of your own as it gives you more freedom.

    1. Selenium-Cucumber framework for testing the web and android apps.
    2. Another one is an acceptance testing framework using Cucumber and Selenium Webdriver.
  11. Adv Java Tutorial
    Selenium Interview Questions

  12. Question 8. What Does A Feature File Contain?

    Answer :

    A feature file in cucumber specifies parameters and conditions for executing the test code. It can combine any of the following.

    1. A feature.
    2. A user scenario.
    3. The scenario outline.
    4. A clause.
    5. A clause.
    6. A clause.
  13. Question 9. What Is A Profile In Cucumber?

    Answer :

    You can create Cucumber profiles to run a set of features and step definitions. Use the following command to execute a cucumber profile.

    cucumber features -p

    #Example: cucumber features -p acceptance

  14. Web Developer Guide Interview Questions

  15. Question 10. What Are Before, After, Beforestep And Afterstep Hooks?

    Answer :

    1. Before: executes before the feature file execution.
    2. After: executes after the feature file execution.
    3. BeforeStep: executes before the each step execution.
    4. AfterStep: executes after the each step execution.
  16. Selenium Tutorial

  17. Question 11. What Are Cucumber Tags? And Why Do We Use Them?

    Answer :

    Cucumber tags help in filtering the scenarios. We can tag the scenarios and then run them based on tags.

    1. We can add tags to scenarios with <@> symbol.
    2. We can use the following command to run a cucumber tagged scenario.

    cucumber features -t @

    Example: cucumber features -t @test

  18. Automation Testing Interview Questions

  19. Question 12. What Is The Purpose Of Cucumber Dry-run?

    Answer :

    We use to compile the cucumber feature files and step definitions. If there occur any compilation errors, then it shows them on the console.

  20. WinRunner Interview Questions

  21. Question 13. List Out Some Of The Main Differences Between Jbehave And Cucumber?

    Answer :

    However, the Cucumber and Jbehave share the same perspective, but there are few key differences.

    1. Jbehave is Java-based and Cucumber is Ruby-based.
    2. Jbehave is story-driven whereas the Cucumber is feature-driven.
  22. Web Developer Guide Tutorial

  23. Question 14. What If You Don’t Use The Cucumber Keywords In Test Steps?

    Answer :

    Please note that it’s not mandatory to write keywords in test steps.

    For example, we can build a test step like the one shown in the next line.

    e.g.- We are testing using cucumber.

  24. Question 15. When Would You Use Rspec And When To Use Cucumber?

    Answer :

    1. RSpec is more successful in doing unit testing.
    2. As you know that Cucumber is a behaviour-driven development tool. So you can use it for System and Integration testing.
  25. Software testing Interview Questions

  26. Question 16. What Are The Steps To Generate A Report In Cucumber?

    Answer :

    We run the following command to produce HTML reports.

    cucumber .feature –format html –out report.html –format pretty

  27. Software testing Tutorial

  28. Question 17. What Is The Right Way To Execute A Specific Scenario From The Feature File?

    Answer :

    We can select the target scenario from a feature file by providing its line number.

    cucumber features/test.feature:10 –format html > testfeature.html

  29. JUnit Interview Questions