#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
🥒 FREE · BDD

Cucumber Step Generator: From Gherkin to Glue Code

Paste your feature file and get one step definition per unique step, with the right parameter types.

  • 🔤 {string} {int} {float}
  • ♻️ Duplicates merged
  • ☕ Java · JS · Python

How to use the Cucumber Step Definition Generator

  1. 1. Paste the featureAny Gherkin with Given, When, Then, And and But, including Scenario Outlines.
  2. 2. Pick a languageJava (cucumber-java), JavaScript (@cucumber/cucumber) or Python (behave).
  3. 3. GenerateCopy the step definitions and fill in each TODO.

How steps become definitions

Each step's text becomes a Cucumber Expression. Quoted text becomes {string}, whole numbers {int} and decimals {float}. For Scenario Outlines, the tool looks at the Examples table: a <seats> placeholder whose values are all whole numbers becomes {int}, and single words become {word}. Steps that differ only in their values share one definition, And and But steps take the keyword of the step before them, and steps followed by a table or doc string get a DataTable or doc string argument. Everything runs in your browser; nothing you enter is uploaded.

For Python, the expressions are converted to behave's parse format, such as "{text}" and {number:d}.

Worked example

The sample enrolment feature has 3 scenarios, including an outline and a data table. The tool finds 9 unique steps; I should see "…" appears in two scenarios but needs only one definition. the course "<course>" has <seats> seats left becomes the course {string} has {int} seats left. A dry run with cucumber-js and with behave found every step defined, and the Java version compiles.

Tips

  • Write steps in business language ("I enrol"), not UI clicks ("I click the blue button").
  • Reuse step wording across features so definitions stay few.
  • Keep assertions in Then steps only.

Frequently asked questions

Why are definitions pending?

Each one throws PendingException (or returns 'pending'), so Cucumber reports them as pending until you add the real code.

Does it support Rule and Background?

Yes. Their steps are included like any other; Rule and Background headings themselves need no code.

Is the Cucumber step generator free?

Yes. You can open the Cucumber step generator and fill in everything without signing up. When you generate step definitions for the first time, we ask once for your name and WhatsApp number; after that it, and every other Uncodemy tool, opens straight away.

More free tools

See all free tools