HomeОбразованиеRelated VideosMore From: QAShahin

JUnit Cucumber Tutorial 01 - Setting Up Cucumber

755 ratings | 188713 views
Java Cucumber JUnit WebDriver video tutorial on setting up Cucumber in a Windows environment. Blog Post: http://www.thetestroom.com/installing-cucumber-tutorial/ Eclipse Download: https://www.eclipse.org/downloads/ Java JRE Download: http://www.oracle.com/technetwork/java/javase/downloads/java-se-jre-7-download-432155.html Video Tutorial Playlists: Java JUnit WebDriver: https://www.youtube.com/watch?v=trRerBifjX0&list=PL_noPv5wmuO-JwfM6uiLcg_IlP9E8U1Hv&index=2 Top Ten Tech Tips: https://www.youtube.com/watch?v=IOC3C83fuTM&list=PL_noPv5wmuO8J36CYT-wkw6tGtNk5ICIN Java Cucumber WebDriver: https://www.youtube.com/watch?v=pD4B839qfos&list=PL_noPv5wmuO_t6yYbPfjwhJFOOcio89tI Ruby RSpec WebDriver: https://www.youtube.com/watch?v=FgGOa7Mxoxg&list=PL_noPv5wmuO9Z3h_Nq4aEPfzGqrJzhthb Links: Selenium: http://docs.seleniumhq.org/download/ Cucumber Jars: http://central.maven.org/maven2/info/cukes/ JUnit Jar: http://mvnrepository.com/artifact/junit/junit/4.11 Hamcrest Jar: http://mvnrepository.com/artifact/org.hamcrest/hamcrest-all/1.3 Cucumber Plugin: http://cucumber.github.com/cucumber-eclipse/update-site JARS: Cucumber Core: http://repo1.maven.org/maven2/info/cukes/cucumber-core/ Cucumber Html: http://repo1.maven.org/maven2/info/cukes/cucumber-html/ Cucumber Java: http://repo1.maven.org/maven2/info/cukes/cucumber-java/ Cucumber JUnit: http://repo1.maven.org/maven2/info/cukes/cucumber-junit/ Cucumber JVM DEPS: http://repo1.maven.org/maven2/info/cukes/cucumber-jvm-deps/ Cucumber Spring: http://repo1.maven.org/maven2/info/cukes/cucumber-spring/ Gherkin: http://repo1.maven.org/maven2/info/cukes/gherkin/ JUnit: http://mvnrepository.com/artifact/junit/junit Hamcrest All: http://mvnrepository.com/artifact/org.hamcrest/hamcrest-all Selenium Server Standalone: http://www.seleniumhq.org/download/ Resources: Introductory music: http://incompetech.com/music/royalty-free/index.html?collection=006&Search=Search
Html code for embedding videos on your blog
Text Comments (316)
Ruslan Lopez Carro (4 months ago)
blog post link is down :/
I. B&A (5 months ago)
merci bq
reshma asrani (9 months ago)
Very well explained, watched the entire series and got to know end to end on Cucumber. Thanks for all your efforts in creating this video series.
Noor Mohmed (1 year ago)
hii i run the feature file like u but the output like that Feature: login action Scenario Outline: scuessful login with valid credantial # C:/Users/core/workspace_java/CucumberConcept/src/cucumber/features/myFeature.feature:4 Given: user in login page When: user view login page sucessfully And: use enters "<username>" and "<password>" Then: message displayed login scessfully Examples: | username | password | | tomsmith | SuperScretePassword! | | noor | password | 0 Scenarios 0 Steps 0m0.000s the implementation of function that will be used not generated and the compiler not recognized the scenario i run
Tamal Das (1 year ago)
Hi, I am getting error when i am executiong the feature file "Exception in thread "main" cucumber.runtime.CucumberException: Unknown option: --plugin" what to do to solve this?? i have used all the jar files in the video..do i have to update those jar file to the recent version??
Syed Yusuf (1 year ago)
can i download eclipse on google chrome book, if yes please advice. thank you
Anu Anick (1 year ago)
very Nice Demonstration. And appreciate your hardwork on creating these tutorials. You are amazing SHahin. -Anam
Choudhury Iqbal (1 year ago)
sound is not clear
keshav dwivedi (1 year ago)
Hi, I am unable to generate the step-definition even when my feature file contains features,scenarios and steps, in the console it displays :- 0 Scenarios 0 Steps 0m0.000s regardless of whether I execute feature file or execute test runnerclass,links are:- 1. https://drive.google.com/open?id=0B5suL2Tlbap5Qm11cVQ2Z2pmSE0 2. https://drive.google.com/open?id=0B5suL2Tlbap5QVB1Y3lRaEJkMVE
Gustavo Navarro (1 year ago)
Kool!
Gustavo Navarro (1 year ago)
and my .feature file : Feature: Submit a valid contact form Scenario: Submit form using valid data Given I am on the zoo site When I navigate to contact And I submit the form with valid data Then I check that the form has been submitted And d
Gustavo Navarro (1 year ago)
Ok now it worked for me, had an isssue with the "Scenario :" , changed to "Scenario:" My code for CucumberRunner.java package cucumber; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions( plugin={"pretty", "json:target/cucumber.json"}, features = {"src/cucumber/"} ) public class CucumberRunner { }
keshav dwivedi (1 year ago)
It got solved by removing : besides given and then tag
Gustavo Navarro (1 year ago)
same here
Ninad Telang (1 year ago)
This is a great teaching. I would like to add some notes - 1. When using firefox webdriver, developer needs to add System.setProperty for geckodriver.exe 2. Webdriver driver has to be set as public static or it will reset to null after each scenario. 3. For Scenario Outline Tables, the feature file must written as Scenario Outline:.....not just Scenario: 4. @Cucumber.Options should be @CucumberOptions. 5. It would be great for a video on how to use protractor for angularjs? 6. Also, I am unable to right click on my Eclipse feature file and make it "Pretty". No option available, although I have successfully added the plugin. Many thanks again, keep em coming.
srinivas trully (1 year ago)
Shahin teaching skills on core concept are amazing, never saw such such a great Instructor. Thank you Shahin Bhai. Allah hafiz.
mayankjamindar (2 years ago)
Hello QAShahin, I am getting below error pls. help on priority: Failed to instantiate public cucumber.runtime.java.JavaBackend(cucumber.runtime.io.ResourceLoader) with [[email protected]]
Kavya Lakshmikanth (2 years ago)
Exception in thread "main" cucumber.runtime.CucumberException: Unknown option: --plugin at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:119) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:50) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:44) at cucumber.api.cli.Main.run(Main.java:20) at cucumber.api.cli.Main.main(Main.java:16) i am using the same jar files as mentioned by you
Mihir Patel (2 years ago)
Hey I am using Cucumber 2.4.0 version and as per your video i was doing the same thing, but I'm getting error at the time of compiling the feature file is like this: Usage: java cucumber.api.cli.Main [options] [ [FILE|DIR][:LINE[:LINE]*] ]+ Options: -g, --glue PATH Where glue code (step definitions and hooks) is loaded from. -f, --format FORMAT[:PATH_OR_URL] How to format results. Goes to STDOUT unless PATH_OR_URL is specified. Built-in FORMAT types: junit, html, pretty, progress, json. FORMAT can also be a fully qualified class name. -t, --tags TAG_EXPRESSION Only run scenarios tagged with tags matching TAG_EXPRESSION. -n, --name REGEXP Only run scenarios whose names match REGEXP. -d, --[no-]-dry-run Skip execution of glue code. -m, --[no-]-monochrome Don't colour terminal output. -s, --[no-]-strict Treat undefined and pending steps as errors. --snippets Snippet name: underscore, camelcase --dotcucumber PATH_OR_URL Where to write out runtime information. PATH_OR_URL can be a file system path or a URL. -v, --version Print version. -h, --help You're looking at it. Exception in thread "main" cucumber.runtime.CucumberException: Unknown option: --plugin at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:119) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:50) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:44) at cucumber.api.cli.Main.run(Main.java:20) at cucumber.api.cli.Main.main(Main.java:16)
QAShahin (2 years ago)
Hi Mihir, sorry to see that your having issues. I would suggest that you try to update to the latest version of each Jar and try again. Also, once you update, I think the cucumber options methods may have become deprecated. You would need to use the more newer versions of the method. Let me know how you get on.
Nagulmeera Shaiks (2 years ago)
Can you post how to retrieving data from excel sheet in cucumber frame work
QAShahin (2 years ago)
Awesome.
Nagulmeera Shaiks (2 years ago)
Ok
QAShahin (2 years ago)
Thanks Nagulmeera, sure thing. Also, call me Shahin :D
Nagulmeera Shaiks (2 years ago)
Hi Thanks for providing videos to me , I have gone through this videos, but I Unable to understood bcoz its too complexity sir,,, I will try to understand some other time
QAShahin (2 years ago)
Hi Nagulmeera, I can most certainly look into this. This said, have you checked out my Keyword framework videos (https://youtu.be/MSTdEyMNVds). I mention these videos since I actually go through how to extract Excel data out and use in a Java class. If you do, make sure to checkout all three videos. Thanks.
Nagulmeera Shaiks (2 years ago)
Hi Can you post parallel test cases in cucumber in the cross browser??
QAShahin (2 years ago)
No problem at all.
Nagulmeera Shaiks (2 years ago)
Thanks for response my comments I will be waiting that videos.
QAShahin (2 years ago)
Hi Nagulmeera, many thanks for commenting and watching. Sure thing, this is something I have been meaning to look into for some time now. Hopefully sometime in the future I will look into this.
Alfredo Dobrões (2 years ago)
Thank you for the vídeo!
QAShahin (2 years ago)
No problem at all Alfredo, I hope you take something positive away from it. Let me know how you get on, if you have any suggestions then feel free to ping me back. Many thanks for checking out my video and for commenting.
Neelanja Makhija (2 years ago)
Hi Shahin, I installed the Cucumber plugin from your description section as below: Cucumber Plugin: http://cucumber.github.com/cucumber-e... I am able to see that green icon file while creating feature file, but the feature file keywords--- 'Feature', 'Scenario', 'Given', 'When', 'Then' etc are not seen as in green font (as keywords). Its usual as in black font like other steps. Could you please suggest as to what could be the issue or if this acceptable as well?
QAShahin (2 years ago)
Not a problem Neelanja. Many thanks for watching.
Neelanja Makhija (2 years ago)
No issues Shahin :) My pleasure. Thanks for your videos :)
QAShahin (2 years ago)
Hi Neelanja Makhija, apologies that I was not able to get back to you, looks like you were super quick in finding a solution. Many thanks for posting your solution here. If someone else has this issue, they will most likely be able to follow your instructions in hopes of resolving. Many thanks once again for checking out my video and commenting.
Neelanja Makhija (2 years ago)
The solution to this problem---Add the latest version of jar files from Cucumber and Junit. Thanks anyways ! :)
Hi Shashin this is a great video really helpful.. I have a question though, do you know how to fix this error? (This is my feature file) error: Step 'I open the browser and access the app' does not have a matching glue code Thanks in advance for your help.
QAShahin (2 years ago)
Hey Jose, many thanks for your comment, sorry to see that your having issues. Based on your error message, it looks like your step in your feature file is not able to locate your step definition method. Have you written a step definition method? If so, perhaps also make sure that your feature file and step class are in the same directory. Let me know how you get on.
nhlanhla mbebe (2 years ago)
Hi, I am watching, JUnit Cucumber Tutorial 01 - Setting Up Cucumber. when trying to run the feature file i am getting the below error. I have imported the Jars as stated on the video. Usage: java cucumber.api.cli.Main [options] [ [FILE|DIR][:LINE[:LINE]*] ]+ Options: -g, --glue PATH Where glue code (step definitions and hooks) is loaded from. -f, --format FORMAT[:PATH_OR_URL] How to format results. Goes to STDOUT unless PATH_OR_URL is specified. Built-in FORMAT types: junit, html, pretty, progress, json. FORMAT can also be a fully qualified class name. -t, --tags TAG_EXPRESSION Only run scenarios tagged with tags matching TAG_EXPRESSION. -n, --name REGEXP Only run scenarios whose names match REGEXP. -d, --[no-]-dry-run Skip execution of glue code. -m, --[no-]-monochrome Don't colour terminal output. -s, --[no-]-strict Treat undefined and pending steps as errors. --snippets Snippet name: underscore, camelcase --dotcucumber PATH_OR_URL Where to write out runtime information. PATH_OR_URL can be a file system path or a URL. -v, --version Print version. -h, --help You're looking at it. Exception in thread "main" cucumber.runtime.CucumberException: Unknown option: --plugin at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:119) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:50) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:44) at cucumber.api.cli.Main.run(Main.java:20) at cucumber.api.cli.Main.main(Main.java:16)
QAShahin (2 years ago)
Hi nhlanhla mbebe, the reason your getting the error above is because the jars in the video are out of date. If you get the latest versions of the jars then this should resolve your issue. You may also need to use the more up to date version of the plugin options. I hope this helps.
nhlanhla mbebe (2 years ago)
May you please create a video with the build tool
nhlanhla mbebe (1 year ago)
Thank you, do you have selenium videos focused on getting responses via a Service Rest services to be specific?
QAShahin (2 years ago)
Hi nhlanhla, yes I do however the details are not in the same video. Have a look at this video (https://youtu.be/7Il_8_YPWtk) which covers how to setup Jenkins. Then have a look at this video (https://youtu.be/EYFwSzsm13U) which covers how to run Cucumber tests in Jenkins. I hope this answers your question.
nhlanhla mbebe (2 years ago)
Hi QAShahin, do you perhaps have videos regarding Jenkins setting it up from scratch and running cucumber automated tests?
QAShahin (2 years ago)
Hi nhlanhla, many thanks for your comment. Can you expand on what you mean? Are you asking that I make a video on running Cucumber tests via a build tool? If so then you may want to checkout my Cucumber Jenkins video at https://youtu.be/EYFwSzsm13U.
Narendra Chetan (2 years ago)
Please suggest me the list of jar files and i got an error at "cucumber.options"
QAShahin (2 years ago)
Hi Narendra, many thanks for your comment. My apologies that it has taken this long to get back to you. I have updated the video description which now includes links to all the Jars. Feel free to check it out. I would suggest that you download the latest version of each jar. Many thanks, Shahin.
Narendra Chetan (2 years ago)
May i know the jar files names, that would be helpful for me to download them easily
QAShahin (2 years ago)
Hey Narendra, welcome to my channel. I would request that you use the latest versions of the jars instead of the version used in this video since the jars have since been updated. I would also request that you use the most latest methods for Cucumber options. Many thanks.
Pragati Chaturvedi (2 years ago)
Hey Thank You so much you are a genie for me
QAShahin (2 years ago)
Hey Pragati, welcome to my channel. Many thanks for checking out my video and for commenting. I hope I will be able to grant all of your future wishes (in the form of questions of course). It would be great if you could checkout some of my other videos. Once again, welcome.
Octavio Restrepo (2 years ago)
Hi All, Does anybody know why I am not getting the run feature option on my Eclipse? it is only appearing "Run as configurations" option I am using: Eclipse Java EE IDE for Web Developers. Version: Neon.3 Release (4.6.3) Build id: 20170314-1500
QAShahin (2 years ago)
That's amazing, I am really happy that it worked out for you. Sadly, plugins from another source is something that I do not control and can only do my best in some general Q&A. Great stuff.
Octavio Restrepo (2 years ago)
Thanks for the quick answer. I had re installed the cucumber plugin and added gherkin-2.12.2.jar to the already existed jar files and it worked
QAShahin (2 years ago)
Hey Octavio, many thanks for watching and commenting on my video. Have you tried restarting your Eclipse? If that does not work then perhaps try removing and re-installing. It is also worth noting that the plugin may not work for some versions of Eclipse. Let me know how you get on.
Edor Kacerja (2 years ago)
hi, I am having the same issue with this exception: Exception in thread "main" cucumber.runtime.CucumberException: Unknown option: --plugin at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:119) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:50) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:44) at cucumber.api.cli.Main.run(Main.java:20) at cucumber.api.cli.Main.main(Main.java:16) 1. My code is as below: package cucumber; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions( plugin={"pretty", "json:target/"}, features={"src/cucumber"} ) public class CucumberRunner { } 2. my feature file looks like this: #Sample Feature Definition Template @tag Feature: Title of your feature I want to use this template for my feature file @tag1 Scenario: Title of your scenario Given sdfsdf When I complete action Then I validate the outcomes 3. the jars are all the latest.
QAShahin (2 years ago)
Based on your code, you appear to be using the newer version. Try removing all the instances of Cucumber options you have from your runner class and see if you get the error. I suspect that the Options have changed although I am not entirely sure. Basically, remove the Options import and the options annotation tag and see if you get the issue. Also, are you using any plugins? For some reason, in eclipse especially, using plugins can lead to issues also.
Edor Kacerja (2 years ago)
hi QAShahin, yes the jars are all the latest and I have tried different versions too, but there is no change in the exception, is always the same. What information can I provide in order to duplicate my issue?
QAShahin (2 years ago)
Hi Edor, sorry to see that your having issues. Are you using the latest versions of the jars? The jars presented in my video are slightly out of date now. Let me know how you get on.
Ray R (2 years ago)
This worked like magic with all updates jars (latest and greatest) and in JAVA 8 @RunWith(Cucumber.class) @CucumberOptions( features={"src/cucumber"}, plugin={"pretty","json:target/"} )
QAShahin (2 years ago)
Hi Ray, that is great. As you may have noticed, the video is a little old now and the code version has moved on. Many thanks for checking out my video.
Alexandre Oliveira (2 years ago)
Amazing ! Thanks for this video, it is really simple and clear. The best that I saw when looking for Cucumber introduction !!!!
QAShahin (2 years ago)
Hey Alex, thanks ever so much for your comment. It really makes my day reading comments such as yours as I truly feel that I have helped make a small difference :D. Many thanks for watching.
Ajay Pitla (2 years ago)
hi, same as 'Christopher Flint', I'm not able to install the cucumber eclipse plugin as it says "could not find http://cucumber.github.com/cucumber-e...".Please advise. Thanks
QAShahin (2 years ago)
Hey Ajay, many thanks for commenting. I suspect that your issue might be related to your firewall rules. Are you able to download any other plugins?
Christopher Flint (2 years ago)
I am not able to install the cucumber eclipse plugin, but when I go to run the feature file, my only option is to select run as, and then run configurations. Could someone help me understand how to run the feature file this way?
QAShahin (2 years ago)
Hey Christopher, feel free to ask as many questions as you like, as many times as you like. I am here to help and will try my level best :D
Christopher Flint (2 years ago)
I actually am working from a government environment and sometimes they block our access to certain URLs. I requested an exception for access to the URL and it was granted so I have now installed the plugin with no issues. Thank you for your timely response! I will probably be bothering you with some more questions on your other tutorials. They are excellent and very informative by the way.
QAShahin (2 years ago)
Hey Christopher, thanks for checking out my video and commenting. Can you expand on 'why you are not able to install the plugin?'. Are there any specific errors which are stopping you?
Cloudy Day (2 years ago)
I run into an issue but it was fix but getting the latest jars for Cucumber, just as FYI
QAShahin (2 years ago)
Thanks Cloudy. Yeah that's right. At the time of uploading this video the technologies were spot on however as time has passed so have the technologies updated hence your issues. Many thanks for watching and commenting.
romeo bien (2 years ago)
DO I NEED TO DOWNLOAD THE JAVA ECLIPSE IN ORDER TO BUILD THE JAVA PROJECT? THAT WASN'T PART OF THE DOWNLOADED FILES
QAShahin (2 years ago)
+romeo bien Hi Romeo, thanks for watching my video. Can I ask you what particular download are you referring to? Do you mean Eclipse or the plugin for cucumber? In either case the IDE and the plugins help you to write the code but are in no way absolutely required. I hope this answers your question.
Kuhle Nkondeshe (2 years ago)
GREAT VIDEO!! For all those getting errors. just update your Jars to the latest and make sure core,java and junit use the exact same version. should fix the errors
QAShahin (2 years ago)
+Kuhle Nkondeshe Thanks Kuhle for your comment and for clearing up the error issues.
I Gede Nurhadi (2 years ago)
Thanks for sharing, great tutorial.
QAShahin (2 years ago)
+I Gede Nurhadi Thanks Gede, I hope you found it useful. If you feel that I have missed any areas then let me know and I will look into it. Great stuff.
allen manor (2 years ago)
nice video . please can someone help me . when i type @RunWith(Cucumber.class) i get an error msg cucmber cannot be resolved to a type
QAShahin (2 years ago)
+allen manor lol call me Shahin.
allen manor (2 years ago)
alright sir
QAShahin (2 years ago)
+allen manor No problem at all Allen, I hope it helped. Let me know if there are any particular areas we want me to consider for my future videos.
allen manor (2 years ago)
@QAShahin thanks so much sir very helpful
QAShahin (2 years ago)
Hi Allen, thanks for your comment. Assuming that you are using the latest version of Cucumber then the options have changed. You should use: @CucumberOptions( format = {"pretty", "html:target/cucumber-htmlreport","json:target/cucumber-report.json"} )This said, checkout my latest Cucumber series which uses a more up to date version of Cucumber and that should also resolve your issue (video @ https://youtu.be/SpDa-AupNV4).
Allen John (2 years ago)
@CucumberOptions(plugin = {"pretty", "html:target/cucumber"}) @Cucumber.Options --> @CucumberOptions format --> plugin The cucumber options have now changed.
Mpho Ntlatleng (1 year ago)
Very Helpful Thanks
QAShahin (2 years ago)
It is great when we help out one another :D
IKS (2 years ago)
God bless you, Thank you there are tears in my eyes,....
Manish Arya (2 years ago)
Could you please make video for Cucumber-jvm with appium ?
QAShahin (2 years ago)
Hi Manish, sorry for the late reply. Yes, I have been strongly considering this for a while now and will visit this video tutorial series at some point.
Jayakumar Mohanavelu (2 years ago)
Great Video.. I have done everything but when I try to execute feature file "I am getting Error: Could not find or load main class cucumber.api.cli.Main"
QAShahin (2 years ago)
Hi there, many thanks for commenting on my video and for watching. You usually get this error when you don't have all the right jars in your class path. Were you able to resolve your issue?
Bogdan Halmaghi (2 years ago)
'cucumber' is not recognized as an internal or external command, operable program or batch file. This is the output that i get when i run for the first time my feature file, I've installed cucumber plugin, i have set my pom file to fetch all the jars... can somebody help me?
QAShahin (2 years ago)
Hi Bogdan, sorry for the late reply. Did you manage to resolve your issue? It looks like perhaps the jars might not be in your class path. I hope this answers your question.
Damian Deavila (2 years ago)
hey guys soo im lost and i dont want to ask questions that have been asked before but here i go. soo i know that this is a bit old so it might be that im dling the wrong jars or something but i just want to know if any of you know. so im getting an error when ever i run the features. this is the error that i get : Exception in thread "main" java.lang.IllegalArgumentException: Not a file or directory: C:\Users\dxd170\workspace\CucumberConcept\src\cucumber\feature\myfeature.feature at cucumber.runtime.io.FileResourceIterator$FileIterator.<init>(FileResourceIterator.java:54) at cucumber.runtime.io.FileResourceIterator.<init>(FileResourceIterator.java:20) at cucumber.runtime.io.FileResourceIterable.iterator(FileResourceIterable.java:19) at cucumber.runtime.model.CucumberFeature.loadFromFeaturePath(CucumberFeature.java:101) at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:54) at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:34) at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:201) at cucumber.runtime.Runtime.run(Runtime.java:109) at cucumber.api.cli.Main.run(Main.java:36) at cucumber.api.cli.Main.main(Main.java:18) i am using cucumber core 1.2.0, cucumber html 0.2.3, cucumber java 1.2.0,cucumber junit 1.2.2 cucumber jvm deps 1.0.5, gherkin 2.12.2 hamcrest all 1.3, junit4.11, selenium server standalone 2.44.0. im not sure what other info i can give you guys. pleas let me know what you guys know so that i can fix it.
QAShahin (2 years ago)
Hi Damian, apologies for the late reply. I believe if you update to the latest version of the jars then it should start to work.
Arthur Guinto (2 years ago)
Why i cannot see under Run the Run Feaure file?
QAShahin (2 years ago)
It should be visible assuming you have installed the plugin. Did you restart Eclipse? Also, sorry for the late reply.
Imran Khan (2 years ago)
I ran the feauture file earlier it threw an error like Exception in thread "main" cucumber.runtime.CucumberException: Unknown option: --plugin at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:119) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:50) after work around as stated below i am getting below error Exception in thread "main" java.lang.NoSuchMethodError: gherkin.formatter.model.Scenario.getId()Ljava/lang/String; at cucumber.runtime.ScenarioImpl.<init>(ScenarioImpl.java:28) at cucumber.runtime.Runtime.buildBackendWorlds(Runtime.java:145) at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:38) at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165) at cucumber.runtime.Runtime.run(Runtime.java:121) at cucumber.api.cli.Main.run(Main.java:36) at cucumber.api.cli.Main.main(Main.java:18)
QAShahin (2 years ago)
Sorry, super late reply from me :( Where you able to resolve your issue?
Andy Lee (2 years ago)
I'm getting the same error.
Do I need to create a new project for all new tests? For example, I have 10 tests - so I need to create 10 projects?
QAShahin (2 years ago)
No of course not. In this I only created a single test, you can go ahead and write as many tests as you wish.
Jaya Kumar (2 years ago)
Thanks for all your efforts of explaining about CUCUMBER , That's a nice tutorial , very helpful .
QAShahin (2 years ago)
Thanks Jaya.
arjun miryala (2 years ago)
So helpful Thank you so much
QAShahin (2 years ago)
Thanks Arjun.
douglas martins Santos (2 years ago)
Excellent video. Thanks
QAShahin (2 years ago)
Thanks buddy.
Nagag Salka (2 years ago)
Getting the following as feature file executed: Exception in thread "main" cucumber.runtime.CucumberException: Unknown option: --plugin. Can you please help me to over come the error here. regards Nag..............
QAShahin (2 years ago)
Hi Nagag, my apologies for the late reply. I can only hope that you were able to resolve your issue at the time. I believe this may have been an issue due to a depreciated method.
Mushfiqua Zaman (2 years ago)
Hi, I am a beginner.  Thanks a lot for uploading very well explained video. I started to write my first feature file. I updated latest jar file and also @CucumberOptions(features="src/cucumber/"). I am getting this exceptionException in thread "main" cucumber.runtime.CucumberException: Failed to instantiate public cucumber.runtime.java.JavaBackend(cucumber.runtime.io.ResourceLoader) with [[email protected]]Please help
QAShahin (2 years ago)
Hey Mushfiqua, apologies for not getting back to you at the time. I think I must have missed your message. I hope you had your issue resolved at the time.
SUBHENDU KARMAKAR (2 years ago)
These videos are really elaborative. Are these related to BDD?
QAShahin (2 years ago)
Yes they are :D Apologies for the late reply.
hari krishna (2 years ago)
Great explanation..! Thank you Buddy :)
QAShahin (2 years ago)
No problem, thanks for watching Hari.
Manas Bhatnagar (2 years ago)
Hi I have eclipse Version: Mars.1 Release (4.5.1) Build id: 20150924-1200 but after installing the plugin and even restarting the eclipse, the plugin doesn't seem to be working. The feature file are not identifying the syntax like Scenario , Feature, etc. any help please?
QAShahin (2 years ago)
Hi Manas, apologies for my late reply. Sadly I don't really have any control over the plugins and really cannot help much in this areas. This said, as your post is almost 7 months old (again, sorry for this), I would assume the plugin as moved on since then.
Mustafa Topçu (2 years ago)
is there any way to run headless driver? i tried htlmunitdriver bu it did not work.
QAShahin (2 years ago)
Hey Mustafa, sorry for my late response. HTML Unit Driver should work. I can only hope that you had your issue resolved at the time.
Vivek Sharma (2 years ago)
Hi, I am not able to import the "@Cucumber.Options", it is throwing error.... Please help
QAShahin (2 years ago)
A belated thanks George for helping out Vivek.
George Pantazes (2 years ago)
@Cucumber.Options has been deprecated. Use @CucumberOptions.
Selam (2 years ago)
I am getting this error and I don't know how to fix it. help please. here is the error:Exception in thread "main" Usage: java cucumber.api.cli.Main [options] [ [FILE|DIR][:LINE[:LINE]*] ]+
QAShahin (2 years ago)
Hi Selam, apologies for my late reply. I hope you had your issue resolved at the time.
Brajesh Sahu (3 years ago)
I am getting the below exception, can you please help me? Exception in thread "main" java.lang.NoClassDefFoundError: gherkin/lexer/Encoding at cucumber.runtime.FeatureBuilder.read(FeatureBuilder.java:154) at cucumber.runtime.FeatureBuilder.parse(FeatureBuilder.java:115) at cucumber.runtime.model.CucumberFeature.loadFromFeaturePath(CucumberFeature.java:104) at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:54) at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:34) at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:235) at cucumber.runtime.Runtime.run(Runtime.java:110) at cucumber.api.cli.Main.run(Main.java:36) at cucumber.api.cli.Main.main(Main.java:18) Caused by: java.lang.ClassNotFoundException: gherkin.lexer.Encoding at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source)
QAShahin (2 years ago)
Yeah that's right, thanks Brajesh.
Brajesh Sahu (2 years ago)
Please download the latest version of cucumber jar and add it to your build path.. It should resolve
Srinivas Ch (2 years ago)
Hi Brajesh Sahu I am getting the same error can you advise me the solution.
Brajesh Sahu (3 years ago)
You the best!!
QAShahin (2 years ago)
Thanks Brajesh.
I ran the feature file but it threw an error like this: Exception in thread "main" cucumber.runtime.CucumberException: Unknown option: --plugin at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:119) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:50) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:44) at cucumber.api.cli.Main.run(Main.java:20) at cucumber.api.cli.Main.main(Main.java:16) I did exactly the same as you did, not sure why I got this error....any set up not done on my side yet? Please help..much appreciated!
QAShahin (2 years ago)
Awesome :D
Itech Pru (2 years ago)
Thanks Izzy Z, loaded up all the current jars and it worked!
QAShahin (2 years ago)
Great stuff Rahul.
Rahul Dantuluri (2 years ago)
thank you, it worked for me.
Nagag Salka (2 years ago)
Hi Lena Thank you very much, I will try with this, hope this should work Regards Nag
Jai TG (3 years ago)
thanks mate!! will check you other videos
QAShahin (2 years ago)
That would be great Jai.
Yasser Elhessy (3 years ago)
Thank you for your wonderful illustration.
QAShahin (2 years ago)
Thanks Yasser.
Kumar Rama (3 years ago)
This Video is awesome, great work! very helpfull. Everything is working fine except that the keywords in the feature file are not highlighted in the color coded as in the video. Any help is much appreciated.
QAShahin (2 years ago)
Hey Kumar, I think this is a plugin and IDE thing. Apologies for the late reply.
chuck nor (3 years ago)
Fantastic video series! Thanks a lot :-)
QAShahin (2 years ago)
:D It is awesome to see a lively community of helpers :D
Selam (2 years ago)
I love you!. I've spent hours trying to figure it out and this fixed my problem.
Sidra Bilal (3 years ago)
+tam norris try this package cucumber; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions( format = {"pretty", "json:target/"}, features = {"src/cucumber/"} ) public class CucumberRunner { }
Gary Seven (3 years ago)
@GBoxT These are incredibly useful tutorials, and at the same time they are INCREDIBLY PAINFUL!! The versions have all changed now. By downloading both version 7 & 8 of the JDK I've managed to get as far as lesson 8 but progress is exceedingly slow because I'm constantly goggling for errors. You've obviously spend a ton of time on these and we're all in your debt. Seriously. Given that you have spent so much time on this, dare we ask you swing through these lessons one more time and add a little note in this comments section so the lessons work again? Again, these are *really* good tutorials and worth a 2nd visit on your part. If you can.
QAShahin (2 years ago)
Hey Gary, apologies for my late reply. I did create a newer series but I think even they may be a little out of date also. I get the Painful point, I do. But sadly the nature of tech is just that, it gets out of date at some point. I may revisit Cucumber again at some point. Hopefully soonish.
Sidra Bilal (3 years ago)
Hi guys those how are getting errors plz download the following jar files and remove the other files with same name cucumber core 1.2.4 cucumber java 1.2.0 cucumber junit 1.2.4 gherkin 2.12.2 these are the new versions these will work Good luck..
QAShahin (2 years ago)
Thanks Sidra
Lena Terekha (2 years ago)
thanks
Viewpoint (3 years ago)
Exception in thread "main" cucumber.runtime.CucumberException: Error parsing feature file C:/Users/Subhra/workspace/CucumberConcept/src/Cucumber/features/myfeature.feature at cucumber.runtime.FeatureBuilder.parse(FeatureBuilder.java:133) at cucumber.runtime.model.CucumberFeature.loadFromFeaturePath(CucumberFeature.java:104) at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:54) at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:34) at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:235) at cucumber.runtime.Runtime.run(Runtime.java:110) at cucumber.api.cli.Main.run(Main.java:36) at cucumber.api.cli.Main.main(Main.java:18) Caused by: gherkin.lexer.LexingError: Lexing error on line 4: 'when this is my second step Then this is my final step %_FEATURE_END_%'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information. at gherkin.lexer.En.scan(En.java:872) at gherkin.lexer.I18nLexer.scan(I18nLexer.java:36) at gherkin.parser.Parser.parse(Parser.java:62) at cucumber.runtime.FeatureBuilder.parse(FeatureBuilder.java:131) ... 7 more Can you please help ??
QAShahin (2 years ago)
Hi Viewpoint, please accept my apologies for such a terrible late reply. I hope you were able to resolve your issue at the time.
Viewpoint (3 years ago)
@RunWith(Cucumber.class) @Cucumber.Options( format = {"pretty","json:target/"}, features = {"src/cucumber/"} ) Cucumber.Options cannot be resolved to a type error message appears for above code.
koundinyadeepak (1 year ago)
Neelanja Makhija Can u pls share the cucumber plugin URL . I am unable to open the http://cucumber.github.com
Neelanja Makhija (2 years ago)
Thanks, it worked well :)
QAShahin (2 years ago)
Yeap, sadly the old version has been depreciated.
Hà Trần (2 years ago)
thank you so much ^^
Ram Kamepalli (3 years ago)
try with @CucumerOptions and import import cucumber.api.CucumberOptions;
Gary Seven (3 years ago)
Love it but it's not working ATM - several ppl have noted this error as have I; Exception in thread "main" cucumber.runtime.CucumberException: Unknown option: --plugin EDIT: See anusha murugesan post below
QAShahin (2 years ago)
Sorry about the issue and my late reply. This is most likely the cause due to old jar versions as downloaded in this video. Please try to download the latest versions instead. I hope you had your issue resolved at the time.
Tushar gupta (3 years ago)
As per your tutorial I did the same and I am getting error on CucumbeRunner.java file I am getting error in below code: @RunWith(Cucumber.class) @Cucumber.Options I tried ctrl +shift+O but its not working. I am stuck here. Please help.
QAShahin (2 years ago)
Hi Tushar, apologies for my late reply. Sadly your message got lost and I have only just (11 months after). I hope you were able to resolve your issue at the time.
Gurru Karthick (3 years ago)
i am getting a error "Exception in thread "main" java.lang.IllegalArgumentException: Not a file or directory: C:\Users\247529\Desktop\Java proj\04082016\CucumberConcept\--plu". while running the feature file. Could you please assist?
QAShahin (2 years ago)
You usually get this error when you are trying to read from a path which does not exist. This said, I think downloading the latest version of each jar should resolve this issue albeit I am very late to answer your issue. I hope you had it resolved.
Adith Naveen (3 years ago)
+Gurru Karthick Hi i've also got this problem, any luck on this
Sudipta Sen (3 years ago)
Very nice. Love the simplicity of the tutorial
QAShahin (2 years ago)
Thanks Sudipta.
Akash Gupta (3 years ago)
hi, I am using the same jar version, u mentioned in the video but getting the following error : Exception in thread "main" cucumber.runtime.CucumberException: Unknown option: --plugin at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:119) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:50) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:44) at cucumber.api.cli.Main.run(Main.java:20) at cucumber.api.cli.Main.main(Main.java:16) I am running this on mac os.
QAShahin (2 years ago)
Was your issue resolved?
chekumar (3 years ago)
+Anil Das TRY ADDING THE BELOW IMPORT import cucumber.api.CucumberOptions;
Anil Das (3 years ago)
+Andreea Draniceanu Nope not working getting same issue.
Andreea Draniceanu (3 years ago)
+Akash Gupta Try using the latest cucumber jar versions. Then replace the Cucumber.Options with @CucumberOptions( plugin = {"pretty","json:target/"}, features = {"src/cucumber/"} )
Gary Seven (3 years ago)
+Akash Gupta Same problem here :( If anyone has a link to resolve this I'm pretty desperate.
anusha murugesan (3 years ago)
I got the below issue: Exception in thread "main" Usage: java cucumber.api.cli.Main [options] [ [FILE|DIR][:LINE[:LINE]*] ]+ Options: -g, --glue PATH Where glue code (step definitions and hooks) is loaded from. -f, --format FORMAT[:PATH_OR_URL] How to format results. Goes to STDOUT unless PATH_OR_URL is specified. Built-in FORMAT types: junit, html, pretty, progress, json. FORMAT can also be a fully qualified class name. -t, --tags TAG_EXPRESSION Only run scenarios tagged with tags matching TAG_EXPRESSION. -n, --name REGEXP Only run scenarios whose names match REGEXP. -d, --[no-]-dry-run Skip execution of glue code. -m, --[no-]-monochrome Don't colour terminal output. -s, --[no-]-strict Treat undefined and pending steps as errors. --snippets Snippet name: underscore, camelcase --dotcucumber PATH_OR_URL Where to write out runtime information. PATH_OR_URL can be a file system path or a URL. -v, --version Print version. -h, --help You're looking at it. cucumber.runtime.CucumberException: Unknown option: --plugin at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:119) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:50) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:44) at cucumber.api.cli.Main.run(Main.java:20) at cucumber.api.cli.Main.main(Main.java:16) can anyone help? Thanks
QAShahin (2 years ago)
Thanks to everyone who helped out.
Amit Yadav (3 years ago)
+anusha murugesan Thanks anusha.. :)
Gary Seven (3 years ago)
+anusha murugesan THANK YOU
Hayley Billingham (3 years ago)
+anusha murugesan YOU ARE A HERO!
anusha murugesan (3 years ago)
+Mustafa Topçu use the version 1.2.4 for cucumber-Java,Cucumber-Junit and Cucumber-core jars. user versin 2.12.2 for gherkinchange the code as below: @CucumberOptions( plugin = {"pretty","jason:Target/"}, features = {"src/Cucumber/"} )It worked for me. Try yourself
Mustafa Topçu (3 years ago)
I got this issue below. Can someone help me please? Usage: java cucumber.api.cli.Main [options] [ [FILE|DIR][:LINE[:LINE]*] ]+ Options: -g, --glue PATH Where glue code (step definitions and hooks) is loaded from. -f, --format FORMAT[:PATH_OR_URL] How to format results. Goes to STDOUT unless PATH_OR_URL is specified. Built-in FORMAT types: junit, html, pretty, progress, json. FORMAT can also be a fully qualified class name. -t, --tags TAG_EXPRESSION Only run scenarios tagged with tags matching TAG_EXPRESSION. -n, --name REGEXP Only run scenarios whose names match REGEXP. -d, --[no-]-dry-run Skip execution of glue code. -m, --[no-]-monochrome Don't colour terminal output. -s, --[no-]-strict Treat undefined and pending steps as errors. --snippets Snippet name: underscore, camelcase --dotcucumber PATH_OR_URL Where to write out runtime information. PATH_OR_URL can be a file system path or a URL. -v, --version Print version. -h, --help You're looking at it. Exception in thread "main" cucumber.runtime.CucumberException: Unknown option: --plugin at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:119) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:50) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:44) at cucumber.api.cli.Main.run(Main.java:20) at cucumber.api.cli.Main.main(Main.java:16)
sampath reddy (1 year ago)
Hi Shanhin When i run feature file it shows same error But when i run runner class ,it gives declarations for undefined methods rply!!
QAShahin (2 years ago)
Hey Mustafa, apologies for my late reply. Did you manage to resolve your issue. If so can I ask you to share it (if you can remember). Many thanks.
Praveen Vasan (3 years ago)
Hi.... I am getting the following error while running the feature file...Exception in thread "main" cucumber.runtime.CucumberException: Only one formatter can use STDOUT, now both pretty and json use it. If you use more than one formatter you must specify output path with PLUGIN:PATH_OR_URL  at cucumber.runtime.formatter.PluginFactory.defaultOutOrFailIfAlreadyUsed(PluginFactory.java:185)  at cucumber.runtime.formatter.PluginFactory.convertOrNull(PluginFactory.java:144)  at cucumber.runtime.formatter.PluginFactory.instantiate(PluginFactory.java:99)  at cucumber.runtime.formatter.PluginFactory.create(PluginFactory.java:87)  at cucumber.runtime.RuntimeOptions.getPlugins(RuntimeOptions.java:241)  at cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:287)  at com.sun.proxy.$Proxy0.uri(Unknown Source)  at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:160)  at cucumber.runtime.Runtime.run(Runtime.java:121)  at cucumber.api.cli.Main.run(Main.java:36)  at cucumber.api.cli.Main.main(Main.java:18)Can anybody help........
QAShahin (2 years ago)
I think downloading the latest version of each jar should not resolve this. Sorry about the late reply.
João Baganha (3 years ago)
+Praveen Vasan, I have the same error here and to fix this I add this jars to my library: cucumber-html-0.2.3.jar hamcrest-all-1.3.jar junit-4.11.jar selenium-server-standalone-2.42.0.jar cucumber-jvm-deps-1.0.5.jar gherkin-2.12.2.jar cucumber-junit-1.2.2.jar cucumber-core-1.2.0.jar cucumber-java-1.2.0.jar
rajat vijaywargiya (3 years ago)
Hi Hans...Your whole library contains awesome videos.....The topics of the videos are really good and are as per the current market. Just wanted some help. I am creating a hybrid framework using selenium Java, and wanted to create some wrapper methods for web actions like click button, enter text in text box, select check box etc. Can you please help me in building these sort of methods so that things like explicit waits , exception handling can be incorporated in them. Any reference regarding the same would also be very helpful.
QAShahin (2 years ago)
Hi Rajat, my apologies for the late reply. Sadly I have just got your message and thought it would only be fair to reply back. I would encourage you write your driver based methods (click) closer to your page objects. However if you wish to abstract them out then you could write them as part of your driver class. The advantage you get by doing this is that you can then abstract out the driver to something else one day, the disadvantage is that the class will most likely grow in size exponentially.
A_11_15 (3 years ago)
Hi GBoxT please do you provide any online course
shancan79 (3 years ago)
Could you please help me out. Thanks in advance!!
shancan79 (3 years ago)
Hi G BoxT, I have been trying to resolve the CucumberOptions issue all day have am having absolutely no luck. I have tried switching from 1.7 to 1.8 and changing to use some of the suggestions in the comments. I am having no luck at all. I use this code: import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions( features={"src/cucumber"}, plugin={"pretty","json:target/"} ) and Java 1.8 and I still get complaints from Eclipse.
QAShahin (2 years ago)
Hi, apologies for the crazy late reply. Did you manage to resolve your issue?
Michael Odibo (2 years ago)
I am almost in tears here, any luck resolving the issue?
Asanka Prabath (3 years ago)
+G BoxT, Thanks for the video, it really helped me as I'm new to Selenium and your other videos are really useful as well. I did all steps exactly you showed in the video, and used the same version of jars. But I do not get the code snippets for the steps. Could you plz help me with that. Thank you very much. This is what I get: Feature: test cucumber Scenario: my first test # C:/Selenium/CucumberTest/CucumberConcept/src/cucumber/features/myfeature.feature:3 Given: This is my first step When: this is my second step Then: this is my final step 0 Scenarios 0 Steps 0m0.000s
QAShahin (2 years ago)
Thanks Sivva for your input.
Sivva Kannan (2 years ago)
We need to remove " : " given next to Given,When and Then
Sivva Kannan (2 years ago)
Getting the same error . any suggestions / updates
Venkatesh K (3 years ago)
Thank you for your Video
QAShahin (2 years ago)
Thanks for your comment.
tech_future (3 years ago)
if you get this: 'format option is deprecated. Please use --plugin instead.' error, you can resolve it by downloading exactly the JAR's in the video including version number - except the swing one which you don't need. using the most recent files causes dependency problems so it won't work. the error "java.lang.NoClassDefFoundError: gherkin/formatter/Formatter" means that gherkin is not interacting with your cucumber project, due to version incompatibilities. use the versions at the start of the video and this goes away. and in the runner class if you get problems with Cucumber.Options(), change it to Cucumber Options(). if Cucumber.class is not recognised, add import cucumber.api.junit.Cucumber my working runner class: package cucumber; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions( features={"src/cucumber/"}, format={"pretty","json:target/"} ) public class cucumberRunner { } hope this helps :)
Santhosh Reddy (3 years ago)
Great Video my friend - Especially who are new to cucumber
Vijay Acharya (3 years ago)
This is how I resolved the format option using JRE1.8. Had to import an additional jar file, import cucumber.api.junit.Cucumber;. Hope this helps package cucumber; import org.junit.runner.RunWith; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; @RunWith(Cucumber.class) @CucumberOptions( features={"src/cucumber"}, plugin={"pretty","json:target/"} )
Geek On Java (3 years ago)
List of Top 10 Best Automated Testing Tools and Frameworks for Java Most programmers spend a lot of time debugging Java code. For most of us, it is not a complex task, but writing test cases manually is a time consuming process. http://geekonjava.blogspot.com/2016/01/top-10-best-automated-testing-tools-frameworks-java-android.html
mansee jadhav (3 years ago)
Video is really informative and good.:). Thank you so much. It worked properly on my windows machine. However it shows following error on MAC when we try to run feature file. cucumber.runtime.CucumberException: No backends were found. Please make sure you have a backend module on your CLASSPATH Please help to solve this issue. :)
Mohammad Majumdar (3 years ago)
This video very helpfull
Penelope Will (3 years ago)
Hi G Box T, First of all great video and explanation of each command used. I am getting following error: WARNING: Cucumber-JVM's --format option is deprecated. Please use --plugin instead. Feature: Proof of concept that my framework works Exception in thread "main" java.lang.NoSuchMethodError: gherkin.formatter.model.Scenario.getId()Ljava/lang/String; at cucumber.runtime.ScenarioImpl.<init>(ScenarioImpl.java:28) at cucumber.runtime.Runtime.buildBackendWorlds(Runtime.java:145) at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:38) at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:165) at cucumber.runtime.Runtime.run(Runtime.java:121) at cucumber.api.cli.Main.run(Main.java:36) at cucumber.api.cli.Main.main(Main.java:18) Can you please guide me on this?
sudhir chauhan (3 years ago)
+Penelope Will I also got the same error when i tried to work on a new project. However my previous projects run without any error. I am using gherkin-2.12.2 jars. Same jars two different projects, older works and newer one throws error that you mentioned. G Box T: Can you please suggest what can be the reason..Thanks in advance..
yogesh bawa (3 years ago)
Thanks man,, its really helpful for me to right my first feature file.
Jia Yang (3 years ago)
The video is so amazing!!
SolidPunns (3 years ago)
For all the people getting the 'WARNING: Cucumber-JVM's --format option is deprecated. Please use --plugin instead.' I did some digging and the 'format' signature is no longer being used. Simply remove that piece of code and should work fine. I am fairly new to cucumber so these videos are helping me a lot. I changed the line to: @CucumberOptions(features = {"src/cucumber/"}) I am still looking for the javadocs but I don't know how to match them on Eclipse to get the tooltip when you highlight the class. This link also helps on working and compatible dependecies for cucumber setup. I am currently running the latest jar with exception of of gherkin. So far it seems to be compat with 'gherkin-2.12.2jar'. The latest one kept giving the same error a lot of you reported. http://mvnrepository.com/artifact/info.cukes/cucumber-core/1.2.4
SolidPunns (3 years ago)
@Penelope Will If i can give you a bit of guidance is that I learned a lot of programming by dealing with these kinds of errors. It makes me pay attention to how we reference libraries and more consideration on how to code.  Keep playing with it. I'm sure you can catch the error. Don't give up.
SolidPunns (3 years ago)
Looks like the 'gherkin' jar file may be causing an issue as you are trying to use a method that may not exist in the library you are trying to access. Or it might be a simple syntax error. It's hard to gauge without knowing the setup.
Penelope Will (3 years ago)
+Francisco J Diaz I am using the same jar. As a matter of fact I am using all the latest jars and still getting following error: Exception in thread "main" java.lang.NoSuchMethodError: gherkin.formatter.model.Scenario.getId()Ljava/lang/String;
sudhir chauhan (3 years ago)
Great videos for someone looking for information on Cucumber. For me all videos have been very helpful. Thanks
WARNING: Cucumber-JVM's --format option is deprecated. Please use --plugin instead. Exception in thread "main" cucumber.runtime.CucumberException: Failed to instantiate public cucumber.runtime.java.JavaBackend(cucumber.runtime.io.ResourceLoader) with [[email protected]] at cucumber.runtime.Reflections.newInstance(Reflections.java:44) at cucumber.runtime.Reflections.instantiateSubclasses(Reflections.java:30) at cucumber.runtime.Runtime.loadBackends(Runtime.java:98) ... I add all jars. Use CucumberOptions. Try cucumber-jvm-deps-1.0.3 and later version... i can`t understand what`s wrong(((
+G BoxT eeeeeeeeee!!! thanks a lot!)
+Александр Турков  I changed --format on --plugin, but it still doesnt work. What is a GLUE ?   http://prntscr.com/8zdabv
solaris051 (3 years ago)
Thank you for the nice tutorial. I just had some trouble trying to run the feature for the first time, which was due to me using incompatible jar libraries as I went with the newest from Maven repo. After downloading the exact jar versions from the tutorial, everything worked correctly!
123DDiva (3 years ago)
Hi GBoxT. Thanks for this tutorial. Its very easy to understand, specially for people from non-programming background. I was able to do the set up; however, i am getting the following error when i run the program: " Caused by: java.lang.ClassNotFoundException: gherkin.lexer.Encoding at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357)" Can you please help me debug and resolve this issue? Thanks a lot!! Appreciate your work!
Pierre kh (3 years ago)
youre awesome mate ! thanx alot, finaly found tutorials with understandable english
Sujit Paraseth (3 years ago)
I watched your entire videos and its just excellent learned a lot. Many thanks for sharing. whats your twitter handle?
Ram Vinoth (3 years ago)
Cucumber.Options is not working for me....I imported all the jar files which you mentioned in video... but stilll i am not able to use Cucumber.Options.. Due to this i am not able to proceed further...Please help me on this.
chandrasekhar narra (3 years ago)
+John Wood Yes its working!! Thank you
Pedro Karsan (3 years ago)
I reached to the 20:01 point just fine In the Console I get the feature file details but I also get a warning message right at the top in red "WARNING: Cucumber-JVM's --format option is deprecated. Please use --plugin instead." what does this mean? I tried Googling but no luck. I'm not using the same jar versions as per your video, I'm using later versions. If I use the same ones as yours then there is no problem, but I guess it's good practice to use later versions.
P Rijal (3 years ago)
+Pedro Karsan Use @CucumberOptions() which will import the options api.
kiran kumar (3 years ago)
Thanks Glass Box T. All your Cucumber tutorials are so clear any person new to Cucumber would instantly go back and implement the framework. Your explanation is clean and crystal clear and understandable. Thank you very much for posting such a great tutorial.Keep up great work!
Suhrid Regmi (3 years ago)
I followed your video but with the latest jar files and I am getting the following error: Exception in thread "main" java.lang.NoClassDefFoundError: gherkin/formatter/Formatter at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at cucumber.runtime.formatter.PluginFactory$1.<init>(PluginFactory.java:53) at cucumber.runtime.formatter.PluginFactory.<clinit>(PluginFactory.java:52) at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:69) at cucumber.api.cli.Main.run(Main.java:31) at cucumber.api.cli.Main.main(Main.java:18) Caused by: java.lang.ClassNotFoundException: gherkin.formatter.Formatter at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 17 more what is wrong with my setup?
123DDiva (3 years ago)
+Pedro Karsan Thanks for the solution! I was facing the same issue, and using gherkin-2.12.2.jar file resolved the issue; however, i do still see the warning that you mentioned above.
Pedro Karsan (3 years ago)
+Suhrid Regmi I got the same. If you remove the gherkin lib and use gherkin-2.12.2.jar instead you should see a better result. You'll see the feature file info but you will also see a warning message at the top "WARNING: Cucumber-JVM's --format option is deprecated. Please use --plugin instead."
Daniel Stoica (3 years ago)
Any idea about why I receive the following errors when I run the feature file, at the end? Exception in thread "main" java.lang.NoClassDefFoundError: gherkin/formatter/Formatter     at java.lang.ClassLoader.defineClass1(Native Method)     at java.lang.ClassLoader.defineClass(ClassLoader.java:760)     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)     at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)     at java.net.URLClassLoader.access$100(URLClassLoader.java:73)     at java.net.URLClassLoader$1.run(URLClassLoader.java:368)     at java.net.URLClassLoader$1.run(URLClassLoader.java:362)     at java.security.AccessController.doPrivileged(Native Method)     at java.net.URLClassLoader.findClass(URLClassLoader.java:361)     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)     at cucumber.runtime.formatter.PluginFactory$1.<init>(PluginFactory.java:53)     at cucumber.runtime.formatter.PluginFactory.<clinit>(PluginFactory.java:52)     at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:69)     at cucumber.api.cli.Main.run(Main.java:31)     at cucumber.api.cli.Main.main(Main.java:18)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) Caused by: java.lang.ClassNotFoundException: gherkin.formatter.Formatter     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)     ... 22 more
Tuyển Bùi Đình (3 years ago)
Great!

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.