Cucumber & Jmeter: 1) What Is BDD?

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 16

CUCUMBER & JMETER

1) What is BDD?

ANS:-BDD is the software development & testing process , & cucumber was developed to support
BDD.

2) Practices/Phases of BDD?

ANS:- discovery, formulation, and automation

3) what is page factory ?

ANS:- Page Factory is a class provided by Selenium WebDriver to support Page Object Design
patterns. In Page Factory, testers use @FindBy annotation. The initElements method is used to
initialize web elements. @FindBy: An annotation used in Page Factory to locate and declare web
elements using different locators

4) Use of @findby?

ANS:-The @FindBy annotation is used in Page Objects in Selenium tests to specify the object location
strategy for a WebElement or a list of WebElements. Using the PageFactory, these WebElements are
usually initialized when a Page Object is created

5) Scenario Outline ?

ANS:- It is also defined as "Scenario outlines are used when the same test is performed multiple times
with a different combination of values." ... Scenario outline is exactly similar to the scenario
structure, but the only difference is the provision of multiple inputs

6) Background in Cucumber?

ANS:-is used to define a step or series of steps that are common to all the tests in the feature file. It
allows you to add some context to the scenarios for a feature where it is defined. A Background is
much like a scenario containing a number of steps.

7) Samplers in jmeterJMeter samplers include:

FTP Request.

HTTP Request (can be used for SOAP or REST Webservice also)

JDBC Request.

Java object request.

JMS request.

JUnit Test request.

LDAP Request.

1
Mail request.

8) Runner Class -

Ans:-This class will use the Junit annotation @RunWith(), which tells JUnit what is the test runner
class. It more like a starting point for Junit to start executing your tests. In the src folder create a
class called TestRunner.

9) What is correlation?

ANS:- Correlation is basically extracting value from one of the requests which can be used in the
subsequent request or any of the request which must be executed further. For extracting values out
from a request, you need processors. Pre-Processors like HTML LinkParser can extract all links from a
page received in response.

10)Why Json plugin used ?

ANS:-The json plugin can be used to execute action methods from javascript and return the output.

11) Data table in cucumber example

ANS:-Data tables are used when we need to test numerous input parameters of a web application.
For example, the registration form of the new user involves several parameters to test, so for this, we
can use the data table. ... The registration form contains the following parameters: User Name.

12 )Explain complete cucumber ?

Q explain about 3 amigos ?

ANS:- Three Amigos are the key stakeholder who participate in example mapping to start working on
problem domain and confirming acceptance

Three amigos meeting the input is user story and business rules

1) Product Owner: - for identify the scope of the application and converting user stories into features

2) Tester:- for generating test scenarios where the application can break

3) Developer:- to go in details into each requirement how the application will excute and what could
be the hindrances

13) Feature File

ANS:-A feature file is usually a common file which stores feature, scenarios, and feature description
to be tested

14) Step def in cucumber

ANS:-When Cucumber executes a Gherkin step in a scenario, it will look for a matching step definition
to execute.

2
15) explain gherkin keywords

The main keywords in Gherkin are: ?

ANS:-Feature.Scenario.Given, When, Then, And, But (Steps)Background. Scenario outline. Examples.

16) What are the tags used for in cucumber ?

ANS:-In Cucumber, tags are used to associate a test like smoke, regression etc. with a particular
scenario.

17) What is test runner file?

ANS:-main class from where junit begins test execution

18) What if error occurred like no such element found and remedy?

ANS;-The NoSuchElementException is thrown when the element you are attempting to find is not in
the DOM

To fix this, change your findElement to be correct

19) Explain TDD in cucumber ?

ANS:-TDD is a Software Development methodology in which first test cases are written in the form of
stories and then allowed to fail. After that the developers write code to pass the test cases thus
implementing the story or requirement.

20) Gave one scenario and asked how will you write feature file for it ?

Scenario: user should be successfully logged in

Given : The one user is already registered successfully

When : The user enters correct credentials

Then : The user logged in successfully

21) Why cucumber why not selenium or uft ?

ANS:-In Selenium, test scripts can be written in Java, C#, etc., while in Cucumber, test scripts are
written in plain text language according to Gherkin language rules. In Selenium, conditional
statements can be used, while in Cucumber, we cannot use conditional statements.

3
22) what is smoke and sanity ?

ANS:-Smoke Testing is a type of testing which is done to assure that the acute functionalities of
program is working fine. ... Sanity testing is done to check the bugs have been fixed after the build.
Smoke testing is also called subset of acceptance testing. Sanity testing is also called subset of
regression testing

23) what are the best practices in cucumber testing ?

ANS:-Avoid conjunctive steps. ...

Reuse step definitions. ...

Use backgrounds wisely.

24) What's jenkins? How did u use it?

ANS:-it is a free web automation server .it is used to do many sw developments like testing,deploying
etc.

used for continous testing and deployment

25) Isjenkins pulling or pushing the code

ANS:-both push & pull

26)Which file jenkins is executing ?

Q What is the difference between jar and war file?

ANS:-Generally, a JAR file contains Java related resources like libraries, classes etc. JAR file is like
winzip file except that Jar files are platform independent. A WAR file is simply a JAR file but contains
only Web related Java files like Servlets, JSP, HTML

27) Json extractor is post or pre ?

ANS:-The JSON PostProcessor enables you to extract data from JSON responses using JSON-PATH
syntax. This post processor is very similar to Regular Expression Extractor. It must be placed as a child
of HTTP Sampler or any other sampler that has responses.

28)types of report formats ?

Json,html, Junit

4
29) Clone ?

30)What's the difference between BDD and TDD ?

ANS:-BDD is Behavior Driven Development. ... TDD is a development practice while BDD is a team
methodology. In TDD, the developers write the tests while in BDD the automated specifications are
created by users or testers (with developers wiring them to the code under test.)

31)How to Jmeter file ?

ANS:-Download Apache Jmeter-->go to downloads and select bin-->click on windown batch


command file

32) Syntax of opening jmeter in non GUI mode ?

ANS:-jmeter -n –t test.jmx -l testresults.jtl.

33) Extension of jmeter file---> .JMX and extension of log file--->.JTL

34)List Listners ?

ANS:-Following is the list of all Listeners in JMeter:

Graph Results.

Spline Visualizer.

Assertion Results.

Simple Data Writer.

Monitor Results.

Distribution Graph (alpha)

Aggregate Graph.

Mailer Visualizer.

35)How does jenkins triggers builds ?

How manually trigger Jenkins build?

ANS:-The Build Review Action can be invoked manually from within Jenkins. From the Jenkins
dashboard, click the job name in the table. Click Build Review in the sidebar menu. Complete the
form to specify the parameters for build. To trigger the build, click the Build button .Automatically

5
Q How do I trigger a build automatically in Jenkins?

ANS:-In Jenkins, go to the project configuration of the project for which you want to run an
automated build. In the 'Build Triggers' section, select 'Build when a change is pushed to GitHub'.
Save your project. Jenkins will now run the build when you push your code to the GitHub repository.

36) Difference between maven and Jenkins ?

ANS:-A maven is a build tool designed to manage dependencies and the software lifecycle. It is also
designed to work with plugins that allow users to add other tasks to the standard compile, test,
package, install, deploy tasks. Jenkins is designed for the purpose of implementing Continuous
Integration (CI).

37)Is there any difference between Git and innersource?

ANS:-Inner source is one approach to modernizing your processes, speeding up development,


overcoming organizational barriers, and improving the quality of your software. As the largest open
source community in the world, GitHub is where open source best practices start. Together, we can
change the way your team builds.

38) What is GitHub and why it is used?

ANS:-Github is a web-based platform used for version control. Git simplifies the process of working
with other people and makes it easy to collaborate on projects. Team members can work on files and
easily merge their changes in with the master branch of the project.

 what are tags in cucumber


 no tags we can create ours 
 In Cucumber, tags are used to associate a test like smoke, regression etc. with a
particular scenario.
 @sanity
 @smoke
 Reports in cucumber 
ANS:-HTML, JSON, JUNIT

 why do we use cucumber


 ANS :-A cucumber is a tool based on Behavior Driven Development (BDD)
framework which is used to write acceptance tests for the web application

6
 Steps for cucumber
 Install java eclipse maven
 Create new maven project, configpom xml with neccesry dependencies, and plugins
 Create feature file
 -
 Configure cucumber with maven
 Add dependencies
 [Java junit

 What is BDD Behavior driven development


 Its idea is to describe specification by example
 how application should behave in very simple user/business focused language (behavior
based)
 allow creating living document which are easy to use
 easy to maintain and consumed by all the users
 derived from TDD

 bdd and tdd diff 


 TDD – means test driven development, in this test are written and that fails because of some
specific functionality and then simple code is used to pass the test and then refactor to
remove the duplication
 BDD – Behavior driven development
based onnbehavior, developer do not write the code so language is user friendly and easy to
understand

 Scenario explanation
 Irail application
 Working on a rail client
 Presently in this irail application all the customer can buy the ticket in advance however the
seat will not be guaranteed
 Requirement- to encourage people to get the reserved seat, irail wanted people to book
their seat during the time the buy the tickets in advance
 Decided to use the agile methodology in the BDD approach for the sdlc
 Seat allocation automatically
 Highlight reserved seats in carriage
 User story- Discovery -BDD helps teams to have the right conversations at the right time so
you minimise the amount of time spent in meetings and maximising the amount of valuable
code you produce. 
 Formulation
 Automation
 BR Application can’t allow booking more than 75% seats in carriage

7

Q. Explain background keyword—

.ANS given statement:- Background keyword is used to group multiple ts into a single group

Q. How to make console output more readable—

ANS:-Just add the code 'monochrome = true' in Cucumber Runner class

Q. Cucumber Expressions –

ANS:- cucumber uses cucumber expressions to link gherkin step with a step definition

15. Difference between word and String Expression in cucumber:

ANS:- word- matches the word without any whitespace. String – matches any single/double
quotedstrings

.What are the 3 amigos ?

ANS:- product owner, tester, developer

Q Listeners in Jmeter :

ANS:- A listener is used to display outcomes or results of the samples.

Q List/types of Listeners in Jmeter

ANS - View results tree, View results in table, Summary report, Aggregate report, Aggregate graph,
Save responses to a file.

Q. Modes of Jmeter : 3 modes-

ANS :-JMeter GUI Mode, JMeter Non-GUI Mode, JMeter Server Non-GUI Mode

Q What is Runner Class?

ANS:- The Runner class provides methods that interact with the runner. This class will use the Junit
annotation @RunWith(), which tells JUnit what is the test runner class.

Q. Dependencies used in Cucumber :

ANS:- maven, gradle, Junit integration, testing

Q Meaning of Monochrome :

ANS:- Monochrome is single color. When object needs to be totally unbiased of color.

2. Files needed for cucumber feature,step definition-

ANS:-Step definition is a java method in a cls with an annotation above it.,

RUNNER-The runner cls provides method that interact with the runner

8
Q. BDD vs TDD

ANS :- • TDD is Test Driven Development. BDD is Behavior Driven Development.

• TDD means writing a test that fails because the specified functionality doesn't exist, then writing
the simplest code that can make the test pass, then refactoring to remove duplication.

BDD means creating an executable specification that fails because the feature doesn't exist, then
writing the simplest code that can make the spec pass

Q . Selenium vs cucumber

ANS• Selenium is an automation tool for web apps, while Cucumber is an automation tool for
behavior-driven development.

• Selenium executes UI tests while Cucumber does acceptance testing

. • Selenium script creation is complex while Cucumber is more simple

Q .tags –

ANS:- In Cucumber, tags are used to associate a test like smoke, regression etc. with a
particularscenario.

Q. pugins and depenciies

ANS:- • most of the work in maven is done using plugins. dependency is just a Jar file which will be
added to the classpath while executing the tasks.

. Pom—

ANS:- A Project Object Model or POM is the fundamental unit of work in Maven. It is an XML file
that containsinformation about the project and configuration details used by Maven to build the
project

Q data driven

ANS-- it means it makes strategic decisions based on data analysis and interpretation

Q List some of the Jmeter listeners

.ANS:- Graph Results, Spline Visualizer, Assertion Results, Simple Data Writer, Monitor Results,
Distribution Graph (alpha),Aggregate Graph, Mailer Visualizer

.Q What are the differences between test plan and test lab?

ANS:- A test plan is a comprehensive document that lays out all major activities associated with a
particular testing project. a test case is only designed to test a particular scenario

Q List some of the samplers in Jmeter

TP Request

. HTTP Request (can be used for SOAP or REST Webservice also)

JDBC Request.

9
Java object request.

JMS request.

JUnit Test request.

LDAP Request.

Mail request

Q .Cucumber with Jenkins integration

Prerequisites for Cucumber with Jenkins Integration:

• Cucumber Test Results plugin

• Cucumber Reports

• Cucumber perf plugin

Q What is bdd and tdd

ANS:- TDD is Test Driven Development. BDD is Behavior Driven Development. TDD means writing a
test that fails because the specified functionality doesn't exist, then writing the simplest code that
can make the test pass, then refactoring to remove duplication. BDD means creating an executable
specification that fails because the feature doesn't exist, then writing the simplest code that can
make the spec pass

Q .How to make console output more readable—

Just add the code 'monochrome = true' in Cucumber Runner class

Q. Practices of BDD—

ANS:-discovery, formulation, and automation

[Q. Explain discovery phase:

ANS:- The process begins in the discovery phase, where the Product Owner or Product Manager
creates acceptance criteria as part of writing a story or feature. The discovery process is
collaborative, and team members also discover and contribute additional criteria.

Q what is Bdd-- .

ANS:- BDD is Behavior Driven Development. . BDD means creating an executable specification that
fails because the feature doesn't exist, then writing the simplest code that can make the spec pass

Q. Bdd advantages: --

ANS:-Artifact, parameterization, code reuse, variation, adaptability

10
Q explain discovery phase in bdd

ANS:- The process begins in the discovery phase, where the Product Owner or Product Manager
creates acceptance criteria as part of writing a story or feature. The discovery process is
collaborative, and team members also discover and contribute additional criteria

Selenium cucumber differences

• Selenium is an automation tool for web apps, while Cucumber is an automation tool for behavior-
driven development. • Selenium executes UI tests while Cucumber does acceptance testing. •
Selenium script creation is complex while Cucumber is more simple

Q. dependencies in cucumber Cucumber-

ANS:-JVM is published in the central Maven repository. You can install it by adding dependencies to
your project. Dependencies. Make sure the Cucumber version is the same for all Cucumber
dependencies.

Q.Monochrome in cucumber

ANS-- Monochrome: This option can either set as true or false (default value is false).

Q. plugins used in cucumber

ANS-- message, progress, json, html,rerun,junit

Q.What is the use of JSON report generated?

ANS :-JSON-Java script object notation is another format for generating Cucumber test reports.JSON
is an object containing a lot of information stored in text format. JSON reports bring a different value
to the table. JSON report can also be used as a payload of information to be transferredbetween
different servers

Q.What are the types of reports generated?

ANS—testrunner.java, eclipse console output, full code,html report output, xml report output

What you do in discovery phase?

The process begins in the diType equation here.scovery phase, where the Product Owner or Product
Manager creates acceptance criteria as part of writing a story or feature. The discovery process is
collaborative, and team members also discover and contribute additional criteria

1. What all tools were used in your ASA assessment?


2. In Jmeter what we use to extract data from a JSON response
3. Is Jenkins pushing or pulling the code? - pull
4. Which file Jenkins is executing? Pom.xml
5. For Mouse Hover which method is used? action

11
6. Runner Class – To execute scripts

1. Cucumber Expressions – optional,alternative,any text escape


2. Difference between word and String Expression – without white space for word
and with for string
3. Some questions on JMeter - OOF
4. Some questions on Jenkins-
5. Dependencies needed for scenario – cucumber-java,junit,selenium-java
6. Explain the Scenario of your MCQ and what tools did you use cucumber, git, jenkins
7. Use of those tools
8. Which are the dependencies you need for your ASA MCQ?
9. What is GIT, Jenkins
10. How Jenkins and eclipse linked: Procedure to push code
11. Why testing.xml is used – To reduce the execution time and to run multiple classes
12. Extent Report -
13. Use of Maven – To manage libraries and dependencies
14. Who can push code to Jenkins? – Jenkins is only for pulling code and build not to push
15. Use of data provider – It provides data to test
16. Class used in data driven testing – io.cucumber.dataTable.DataTabledatatable
17. Assertion and types of assertions -
18. Listeners and types of listeners -
19. Modes of Jmeter
20. Difference between TDD and BDD
21. Difference between Cucumber and Selenium
22. What is Runner Class?- executing scenario AND ADD PLUGINS AND TO CONFIGURE
23. Dependencies used in Cucumber
24. Meaning of Monochrome=True
25. What is the role GIT, Jenkins, Testng and Maven?
26. Can we execute without Maven?
27. Advantage of using Cucumber in BDD techniques
28. What is a feature file and in which language is it written? gherkin
29. What is the FindElement Used for - To find elemnt
30. explain what is bdd
31. explain how bdd helps organization's
32. what is tdd?
33. there are 100 step definitions in cucumber, I want to reduce no of step definitions what
approach is best?
34. How is page object model used?
35. how code reusability is done in cucumber?
36. give all the gerkins keywords

12
37. Does order of the gerkins keywords matter(given,when,then..) yes
38. explain data table in cucumber
39. What are the steps to run in cucumber?
ANS:
Create feature file
Configure the runner class
Run the runner class
Step definitions will be created
40. Role of POM in cucumber?
41. Full form of vbScript? Visual basic
42. Gherkin keywords
43. Difference between executing feature file and while cucumber project
44. How to reduce step definitions steps in cucumber? Any idea
45. Tags in cucumber scenario, screnario outline, examples, feature
46. Bdd vs tdd
47. What is correlation?
48. List some of the Jmeter listeners
49. what is your fav topic from the training module-cucumber
50. Where is cucumber used - BDD
51. Y data table is used – To reuse the code
52. Scenario
53. Reports of cucumber
54. Difference btw word and string
55. Data types in cucumber
56. String s is small or big
57. Reports in cucumber
58. Page object model explanation
59. Web elements used in page obj modelfindby,findbys
60. Cucumber with Jenkins integration
61. 2. Diff word and string
62. (Only Cucumber related questions)
--------------------------------------------------------------------------------------------------------------------------
----------------------
63. What is bdd and tdd
64. Explicit wait
65. Descriptive programming in uft
66. Locators in selenium
67. Why we use it
68. Special character usedfor data table “<cucumber>”
69. BDD

13
70. Practices of BDD
71. Special character usedfor data table “<cucumber>”
72. BDD
73. Practices of BDD
74. Cucmber expression
75. what is Bdd
76. Bdd advantages
77. Can we proceed to the formulation without discovery, how does it affect?
78. what are concrete examples
79. explain discovery phase in bdd
80. How do Youknow you have come to an end of formulation of test conditions?
81. BDD and TDD practice sequence
82. Gherkin Step Sequence

TRAINER: ARAVIND KUMAR

83. Explain scenario


84. What is BDD
85. What is runner class
86. diff between selenium and cucumber
87. What is your project

TRAINER: KRITHIKA
88. Scenario explanation
89. Practices in cucumber
90. Reports in cucumber
91. Types of recording modes in uft
92. Diff bet analog and low-level recordings
93. locators in uft
--------------------------------------------------------------------------------------------------------------------------
----------------------
94. Selenium cucumber differences
95. dependencies in cucumber
96. plugins used in cucumber
97. Practices in cucumber
98. What you do in discovery phase?
99. He asked me to show how to add html report in runner class
100. How to use data driven testing (scenario outline)
101. 1. Explain scenario
102. 2. What are types of maven repositories
103. 3. Explain about plugins and dependencies
104. 4. Which plugins have you used?

14
105. 5. Explain the structure of pom
106. 6. What is the style in which pom is written
107. 7. Explain BDD and TDD
108. 8. What's the difference between BDD and TDD
109. 9. What is Data Driven Testing
110. 10. How do you open a jmeter file
111. 11. Syntax of opening jmeter in non GUI mode
112. 12. Extension of jmeter file and extension of log file
113. 13. What are the types of listeners in jmeter

2. Diff between scenario outline & scenario

3. Give library lending books as a requirement & to explain the feature file

114. 4. Languages used in writing step definition in cucumber

What is feature file?

If no such element found, what's the remedy?

Which is best (implict/explicit wait) and why?

1. Explain scenario

2. Situation based on the given scenario and write feature file

3. What is TDD?

4. Scenario and scenario outline

5. Language used in step definition

115. 1.First question is to explain scenario


116. 3.Explain TDD with real time example
117. 4.Gave one scenario and asked how will you write feature file for it
118. 1.explaining scenario
119. 2.Situation based on the scenario and writing a feature file for it
120. 3.what is smoke and sanity
121. 4.what are the best practices in cucumber testing
122. Sme:jayapriya
123. 1. What is your project

4. Page object model

-They have asked 2 reports, so we have json and HTML.

-They have asked us to run @sanity so we use tags=@sanity

-They have asked to give the path of feature file so we use features= and specify the path.

-glue is to specify the step definition location.Here they have the step definition in the package name
cucumber,so they have written glue=cucumber.

-Dry run is to check whether all the steps in feature file has a equivalent method in step definition.

- monochrome is to give the output in readable format.

15
What is page object ?

Why we use Cucumber tags

124. Why is test runner file used


125. What gherkin keyword u will use when u want to run the same test multiple times
126.

16

You might also like