I am working with Intellij IDea and Appium and i have also installed cucumber. But i am unable to navigate to the step definition from the feature file by holding Ctrl button and clicking on the step.. It says "Cannot find declaration to go to". I have the step definition defined already but still it doesn't navigate.. Can any one suggest me any solution for this? Any help is appreciated.
6 Answers
Install the "Cucumber for Java" plugin in IntelliJ IDEA. It will give you the support you are asking for.
Search for plugins called Cucumber
and you will find one written by Jetbrains that you want.

- 4,098
- 3
- 18
- 25
-
Hey thanks a lot @Thomas Sundberg that works for me.. :) – girish Jul 22 '16 at 10:04
-
This must be the least useable answer ever. This error happens very frequently, also on projects where the Cucumber for Java plugin has been installed allways. – kakemonsteret Apr 27 '23 at 10:18
The Eclipse feature that you are describing is called "Open declaration" and according to the official Eclipse documentation, it will attempt to navigate to the exact definition of the selected element if the selected element is a reference or a declaration.
In this case, the feature file steps are not a declaration and not even a java file. That won't work.

- 6,709
- 8
- 57
- 91
-
ohh.. But i am using intellij idea community edition.. it is very difficult to manually search and find the declaration.. can you please suggest some other way to do this in Intellij idea? – girish Jul 21 '16 at 08:36
-
Mentioning that it was IntelliJ IDEA you needed help with would have been a good idea in your original question. – Thomas Sundberg Jul 22 '16 at 07:48
Go File->Settings--> plugins Then you can manage cucumber plugin as shown below This should redirect you to step definition when you click your test.
Hope this helps

- 1,060
- 3
- 19
- 47
-
-
This helps but Thomas Sundberg already gave the answer and i marked it as correct already. So thanks a lot for taking the trouble to show it visually :) – girish Nov 08 '16 at 11:30
Need to install Natural plugin which is available in eclipse market.
Then open your feature file, Just keep cursor on any step & click Fun+F3 key together, it will take you to steps definition file corresponding to the steps.
Note-> This works on Mac, i am not sure about other OS.

- 1,085
- 9
- 5
Use below plugins for navigation purpose.
Go to eclipse or any ide > install new s/w, provide this url > ok URL-> http://rlogiacco.github.com/Natural
Restart ide > open any feature file > press command key if you are using mac or press control in case of windows & focus on any line which is present in the feature file > click > it will take you to respective steps definition file & method.

- 1,085
- 9
- 5
Following 3 steps are quite handy while configuring any Cucumber project from new/existing in Eclipse:
- Install these 2 Plugins from Eclipse Marketplace - Cucumber Eclipse & Natural
- Right-click on project and select Configure -> Convert to Cucumber Project...
- Install pending Eclipse updates, if any.
This will solve the original problem of navigation to step definition file from feature file in Eclipse as well.

- 21
- 2