Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run as cucumber feature not showing in eclipse

I am new to automation. Im facing this problem while running cucumber feature. It doesnt show run as Cucumber feature option at all

Screen shot of Run as options in eclipse

like image 760
omer siddiqi Avatar asked Feb 22 '17 18:02

omer siddiqi


People also ask

How to run cucumber code in Eclipse?

As, when you open a feature file in Eclipse and right-click, then you do not find an option 'Run As->Cucumber Feature', it appears that your Eclipse do not have the required Cucumber Eclipse Plug-in. You can install this plug-in using following steps: Launch Eclipse and navigate to 'Help->Install New Software'.

How to uninstall cucumber-Eclipse features and plug-ins?

As there is no mechanism within Eclipse to permanently and physically uninstall a feature and its plug-ins, you will have to manually remove the files associated with the cucumber-eclipse features and plugin when Eclipse is not running. Warning Note: Be very cautious as to which files you delete, and always have a backup of your Eclipse directory.

How do I run a test in cucumber IDE?

In the Project tool window ( Alt+1 ), right-click the features folder and select Run all Features in: <directory name>. If there are other testing frameworks in your project, the IDE will prompt you to select how you want to run your tests: as Cucumber features or as tests of another framework.

How do I run cucumber feature files?

The Cucumber feature files are run same way as the other executables, with certain run/debug configuration settings. Prior to running a test, you have to set up run/debug configuration for a particular feature file or scenario, or for the whole bunch of features within a directory.


2 Answers

As, when you open a feature file in Eclipse and right-click, then you do not find an option 'Run As->Cucumber Feature', it appears that your Eclipse do not have the required Cucumber Eclipse Plug-in. You can install this plug-in using following steps:

  1. Launch Eclipse and navigate to 'Help->Install New Software'.
  2. Click on 'Add' button
  3. Enter any name e.g. 'Cucumber' and type 'http://cucumber.github.com/cucumber-eclipse/update-site' as location.
  4. Click on OK.
  5. 'Cucumber Eclipse Plugin' option will appear in the available software list.
  6. Select the check box against it and click on 'Next' button.
  7. Read the terms of license agreement and click on 'I accept the terms of the license agreement” if you agree with the license terms.
  8. Click on 'Finish' button.
  9. Let it install, it will take few seconds to complete.

After successful installation of this plug-in, if you open any feature file (i.e. file with .feature extension) and right-click, you should see 'Run As->Cucumber Feature' option.

Update 1

In Eclipse, go to 'Windows->Preferences->Run/Debug/Launching/Launch Configuration' and uncheck 'Cucumber Feature' checkbox if it is checked. Refer to below screen shot for more details:

enter image description here

like image 174
Mahipal Avatar answered Oct 16 '22 18:10

Mahipal


If it is a maven project make sure you have included it as a dependency. If you are running it as automation it would be a good idea to set it up as a maven project.

It's hard from your brief description, but if you are seeing the 'Run as Cucumber Feature' but it isn't doing anything, I had to open up the feature, right click on the white space in it, and then run as Cucumber Feature there. For some reason that worked for me.

like image 26
canpan14 Avatar answered Oct 16 '22 18:10

canpan14