Cucumber Flashcards

1
Q

Explain Cucumber shortly

A

Cucumber is a tool that is based on Behavior Driven Development (BDD) methodology.

The main aim is to make QAs , Business Analysts, Developers understand the application without diving deep into the technical aspects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What language is used by Cucumber

A

Gherkin - simple English representation of the application behavior

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is meant by a feature file?

A

a high-level description of an Application Under Test (AUT)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the various keywords that are used in Cucumber for writing a scenario?

A

Given
When
Then
And

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the purpose of a Scenario Outline in Cucumber?

A

This is ideally used when the same scenario needs to be executed for multiple sets of data, however, the test steps remain the same.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What programming language is used by Cucumber?

A

multiple programming languages such as Java, .Net, Ruby etc.

It can also be integrated with multiple tools such as Selenium

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the purpose of the Step Definition file in Cucumber?

A

to segregate the feature files from the underlying code.

Step Definition files are written in programming languages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the major advantages of the Cucumber framework?

A

Cucumber is an open-source tool.
Plain Text bridges communication gap
Easy to maintain and understand
Easy integration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Provide an example of a feature file using the Cucumber framework.

A

Feature: Login to the application under test.

Scenario: Login to the application.

Given the Open Chrome browser and launch the application.
When the user enters the username onto the UserName field.
And User enters the password into the Password field.
When the user clicks on the Login button.
Then Validate if the user login is successful.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Provide an example of a Scenario Outline using the Cucumber framework.

A

Scenario Outline: Upload a file

Given that the user is on upload file screen.
When a user clicks on the Browse button.
And user enters onto the upload textbox.
And user clicks on the enter button.
Then verify that the file upload is successful.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the purpose of the Behaviour Driven Development (BDD) methodology in the real world?

A

to understand the functionality of an application in simple plain text representation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the limit for the maximum number of scenarios that can be included in the feature file?

A

a maximum of 10 scenarios

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the use of Background keyword in Cucumber?

A

to group multiple given statements into a single group

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What symbol is used for parameterization in Cucumber?

A

Pipe symbol (|) is used to specify one or more parameter values in a feature file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the purpose of Examples keyword in Cucumber?

A

to specify values for each parameter used in the scenario. Scenario Outline keyword must always be followed by the keyword Examples.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the file extension for a feature file?

A

File Extension for a feature file is .feature. A feature file is ideally written in a notepad file and is saved with the extension feature.

17
Q

What is the purpose of the Cucumber Options tag?

A

to provide a link between the feature files and step definition files.

@CucumberOptions(features=”Features”,glue={“StepDefinition”})

18
Q

How can Cucumber be integrated with Selenium WebDriver?

A

by downloading the necessary JAR files.

19
Q

When is Cucumber used in real-time?

A

enerally used in real-time to write acceptance tests for an application. It is generally used by non-technical people such as Business Analysts, Functional Testers, etc.

20
Q

Provide an example of Background keyword in Cucumber.

A

Background: Given the user is on the application login page.

21
Q

What is the use of Behavior Driven Development in Agile methodology?

A

In Agile methodology, user stories can be written in the format of feature file and the same can be taken up for implementation by the developers.

22
Q

Explain the purpose of keywords that are used for writing a scenario in Cucumber.

A

“Given” keyword is used to specify a precondition for the scenario.

“When” keyword is used to specify an operation to be performed.

“Then” keyword is used to specify the expected result of a performed action.

“And” keyword is used to join one or more statements together into a single statement.

23
Q

What is the name of the plugin that is used to integrate Eclipse with Cucumber?

A

Cucumber Natural Plugin is the plugin that is used to integrate Eclipse with Cucumber.

24
Q

What is the meaning of the TestRunner class in Cucumber?

A

TestRunner class is used to provide the link between the feature file and step definition file.

25
Q

What is the starting point of execution for feature files?

A

the starting point of execution must be from the TestRunner class.

26
Q

Should any code be written within the TestRunner class?

A

No code should be written under the TestRunner class. It should include the tags @RunWith and @CucumberOptions.

27
Q

What is the use of features property under the Cucumber Options tag?

A

to let the Cucumber framework identify the location of the feature files.

28
Q

What is the use of glue property under the Cucumber Options tag?

A

to let the Cucumber framework identify the location of step definition files.

29
Q

What is the maximum number of steps that are to be written within a scenario?

A

is 3-4 steps.