You are on page 1of 1

BDD sample example

BDD is Behaviour driven development, suppose you have a test case like when user
enters user name, password then click on the . login button then user should get
login successfully.

so if you want to automate above test case then you would write code to:

launch a browser
enter the user name in the username field
then code for entering the password
and at last the code for click on the login button
so all this is a code if you show your code to BA, a client they won't understand
it

as BA and client or any non-technical persona would have very less knowledge about
the code. so here the BDD comes in picture

so the same thing in BDD you would have to write in below

Scenario: user login check

WHEN user enters username

AND password

AND click on login button

THEN user should get successfully logged in

and each line will have a method associated with it like user enters username..so
this will have a method which will enter the username same with a password, login
button

so the benefit here is if you show this BDD script to BA, Client or any non-
technical person he would understand it as this is written in plain English
language.

this way you have to write your scripts for all the use cases/test cases and this
also serves a purpose of documents.

You might also like