Code Vault

LeanFT Cucumber Framework – Lets talk Gherkin !

Imagine a room full of 50 people and you whisper a story in the ears of the first person and he narrates it to the second and so on till the 50th one. I’m pretty sure that if you narrated the first person “Star Wars”, then what you get from the 50th one would be something like “War of the Stars”. Somewhat analogous to our daily life in IT, a lot of the times what the client wants and what he ultimately gets are two different stories altogether 🙂

This is where the importance of communication can be realized. Behavior Driven Development(or BDD) aims to address issues like this by establishing a common vocabulary which is equally understandable by all stakeholders of a project. A language called Gherkin is used to define Features which contain scenarios which are nothing but a sequence of “Given,When,Then” statements that define a user flow in your application. Example:-

Cucumber, one of the most popular BDD frameworks can be used in conjunction with LeanFT to create a robust setup for Test Automation where the scenarios like the above can be converted into corresponding lines of code. I gave this a shot and the code is present on my GitHub account. Feel free to have a look at the code and make it your own. Suggestions/Comments welcome !

Happy Automating!

Harshit Kohli

Advertisements

1 reply »

  1. com.hp.lft.sdk.GeneralLeanFtException: An Internal problem has occurred, please make sure the LeanFT sdk was properly initialized.

    can you help me with this error? i’m using leanFT with cucumber.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s