#4 - Cucumber Feature File mapping with Step Definition - Important Tips

#4 - Cucumber Feature File mapping with Step Definition - Important Tips

Naveen AutomationLabs

3 года назад

111,733 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Beyond_The_Lines
Beyond_The_Lines - 08.06.2023 16:52

in my case some of the gherkin key are showing yellow flag while other dont why

Ответить
Sushma Reddy
Sushma Reddy - 03.04.2023 18:39

Hi Naveen
Thank you and really appreciate your efforts. I have quick question: In my project we are using step definition file. I am new to this API automation as well as Karate framework. How do i know from where integrating methods. We are using IntelliJ IDE. Java is pgm language.

Ответить
Devashish Mathur
Devashish Mathur - 31.01.2023 12:36

Hey Naveen, Cucumber options has been depreciated now, cab you please show how to create new Test Runner class using Junit Platform Engine?

Ответить
Hitesh Gupta
Hitesh Gupta - 27.01.2023 10:17

Your videos are really helpful and gives brief info on any feature ... was having one doubt on the same topic i.e. how to extract feature file name from .feature file to step definition class ?

Ответить
prakash kodalkar
prakash kodalkar - 02.12.2022 02:11

Great explain 👍👍👍

Ответить
kanak Singh
kanak Singh - 13.11.2022 20:05

WARNING: You are using deprecated Main class. Please use io.cucumber.core.cli.Main
Exception in thread "main" java.lang.NoClassDefFoundError: io/cucumber/gherkin/GherkinParser
at io.cucumber.core.gherkin.messages.GherkinMessagesFeatureParser.parse(GherkinMessagesFeatureParser.java:41)
at io.cucumber.core.feature.FeatureParser.parseResource(FeatureParser.java:46)
at java.base/java.util.function.BiFunction.lambda$andThen$0(BiFunction.java:70)
at io.cucumber.core.resource.ResourceScanner.lambda$processResource$1(ResourceScanner.java:79)
at io.cucumber.core.resource.PathScanner$ResourceFileVisitor.visitFile(PathScanner.java:75)
at io.cucumber.core.resource.PathScanner$ResourceFileVisitor.visitFile(PathScanner.java:60)
at java.base/java.nio.file.Files.walkFileTree(Files.java:2812)
at io.cucumber.core.resource.PathScanner.findResourcesForPath(PathScanner.java:53)
at io.cucumber.core.resource.PathScanner.findResourcesForUri(PathScanner.java:31)
at io.cucumber.core.resource.ResourceScanner.findResourcesForUri(ResourceScanner.java:61)
at io.cucumber.core.resource.ResourceScanner.scanForResourcesUri(ResourceScanner.java:134)
at io.cucumber.core.runtime.FeaturePathFeatureSupplier.loadFeatures(FeaturePathFeatureSupplier.java:62)
at io.cucumber.core.runtime.FeaturePathFeatureSupplier.get(FeaturePathFeatureSupplier.java:45)
at io.cucumber.core.runtime.Runtime.run(Runtime.java:80)
at io.cucumber.core.cli.Main.run(Main.java:87)
at cucumber.api.cli.Main.run(Main.java:30)
at cucumber.api.cli.Main.main(Main.java:15)
Caused by: java.lang.ClassNotFoundException: io.cucumber.gherkin.GherkinParser
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 17 more

Not able to run my feature file. Could anyone please help

Ответить
Sana A
Sana A - 29.04.2022 21:36

Hi Sir, Can please make the video on the JBhave with maven

Ответить
Ahmet TEMEL
Ahmet TEMEL - 26.04.2022 04:35

thank you

Ответить
Giovanni Guerreiro
Giovanni Guerreiro - 14.04.2022 16:35

Fantastic like always!

Ответить
Henry Leu
Henry Leu - 03.04.2022 16:25

I use Eclipse. My other cucumber project can run feature file and show me to define step definition. But when i created my 2nd project in Eclipse, when I run feature file, it doesn't show me any step definition that I will need to create. WHy?

Ответить
Anuran Mondal
Anuran Mondal - 08.03.2022 10:45

Why and is getting mapped to then over here?

Ответить
Yashu Y
Yashu Y - 30.01.2022 21:12

Thank You, Sir !

Ответить
pravin jadhav
pravin jadhav - 13.01.2022 21:55

great man. you are always there with a solution video. Thanks again and again My Automation Guru.

Ответить
Devashree Vijay
Devashree Vijay - 15.12.2021 11:20

Your videos are good. but contents are not visible. Please show by zooming in.

Ответить
partha saradhi
partha saradhi - 05.10.2021 16:05

Hi @naveen Hi really good video But i'm getting initialization error while running the test runner file.... Its telling that "Method 'initialization error' not found.Opening the test class"

Ответить
Diksha Gupta
Diksha Gupta - 27.09.2021 19:00

Hi Naveen sir, is there any plugin which help to merge to junit XML file

Ответить
manish thakur
manish thakur - 18.09.2021 19:47

Hi naveen i have built the same project as you teach also copied your pom

But i am getting test class not found in project error
I have tried by changing path in class file still i am getting same issue. Please provide the solution i am bit frusted due the issue please help sir

Ответить
Sanjana S
Sanjana S - 12.08.2021 09:35

Thanks a million! this video was exactly what i was looking for!

Ответить
Abhishek Kumar
Abhishek Kumar - 17.07.2021 19:16

we can directly run Runner class which shall automatically find the missing step defs ..

Ответить
satya guddu
satya guddu - 09.07.2021 14:42

Hello Naveen, Is this possible to add multiple annotation in one step definition. I have two scenarios where in one scenario same step can be used with Then and another is with And annotation. So I should write two steps definition for each with duplicate code(which i will not prefer to do) . Could you please highlight on this?

Ответить
Shivam Tiwari
Shivam Tiwari - 18.06.2021 00:03

can we run two feature files run from one test runner like both feature files mapped to different step def and we have to run both the feature one by one , can we do this

Ответить
Kamal
Kamal - 15.06.2021 20:21

Naveen you life saver

Ответить
Nakul Paul
Nakul Paul - 15.06.2021 10:54

im running a feature file as "Run as configuration"

i have not defined any steps

instead of flagging for undefined steps, its running with no output, test success

what could be reason that undefined steps are not coming up ?

Ответить
Supriya S Sampath
Supriya S Sampath - 08.06.2021 00:05

Amazing tutorial. You are jus wow Naveen.

Ответить
Badri Khanal
Badri Khanal - 29.05.2021 20:07

My test is showing "steps undefined". The only difference between your code and my code is "import io.cucumber.java.en.Given". I do not know from where you got this import. I get error if I use this import. So I have used "import cucumber.api.java.en.Given"

Ответить
BR Coding Skills
BR Coding Skills - 28.05.2021 16:51

hi.. Can you please tell me which Screen recorder is using on your laptop for recoding audio and video purpose ?

Ответить
shital belokar
shital belokar - 27.05.2021 20:27

Thanks sir for great video but could you please make a video on how to run multiple features file using runner class.

Ответить
Pradeep Kumar
Pradeep Kumar - 24.05.2021 16:23

Hi sir,
What is the solution for regeneration step definition? Step Definition is generated when I run the feature file for the first time. The step definition is generated when i run the Java class again after implementation in the Java class.Result : (you can implement the missing steps with the snippet given below:
1) with scenarios (1 undefined)
3 steps (1 omitted, 2 undefined) while step definition has already been generated and implemented.

Ответить
Shradha Ingewar
Shradha Ingewar - 19.05.2021 06:15

Hi Naveen, I have created the same feature file, but the run configuration generated step definitions only for last 3 lines, and when I created step definition file with those 3 steps, the code was running successfully without any warning for missing glue code of Given And When situation. Can you please help me with this situation.

Ответить
Bharat Goklani
Bharat Goklani - 12.05.2021 08:41

How can i have 2 separate step definition files with 1 feature file ?
My requirement is that for the same feature file I need to have 2 separate step definition file (one for component test and one for integration test).

Ответить
Rott life
Rott life - 04.05.2021 10:13

Hi Naveen,
i am facing following issues

1. Am using windows 10 and eclipse IDE version 2020-09
Following your video i created a feature file and its step definition file
Andi can only execute the feature file by right clicking on the feature page ->RunAs -> cucmber feature
But i cannot execute the feature file by right clicking on feature file name ->RunAs -> cucmber feature in the explorer

2. AutoNavigation from feature file to stepDefinition file is not happening for few when i try to perform using ctrl+mouse hover and click
i checked with naming and even spaces everything is looking same in both the files "feature" "stepDefinition"

3.And also getting this warning in feature file
Multiple markers at this line
- The resource is a duplicate of src/test/resources/features/uber.feature and was not copied to the output folder
- 8 changed lines
And i created this resource source folder based on the lecture and i dont know where it is referring for duplicate.

Solution from peers also highly appreciable
Thanks in advance

Ответить
Harpreet kaur
Harpreet kaur - 03.05.2021 04:39

Hi Naveen,
How can we run two feature file one after another?
I have created two feature file- one is for login and second one is of clicking on any menu items after login.

Ответить
QATesting Researcher
QATesting Researcher - 02.04.2021 22:00

Hi Naveen,

Thank you for the video, code seems to successful but the only issue is on ctrl +hovering the feature file is not getting higlighted(. Kindly note the plugin is the latest and even the project is converted(I can see green icons also).

Ответить
Dhara Patel
Dhara Patel - 21.03.2021 22:40

If the feature file is not showing colours or steps as link .. Go to your feature file right click open with Editors it will work most properly 👍🏻

Ответить
Karunakara NH
Karunakara NH - 19.03.2021 14:27

I am writing 3 scenarios in 3 different feature files and step definition files. The first 2 steps are the same in all 3 scenarios. will it work or will show some error here?? Anyone please suggest me here

Ответить
Archana Archu
Archana Archu - 08.03.2021 15:49

Hi Naveen,
I was able to install new plugin followed by converting to cucumber project as well. In feature file I was able to see green color dots eventhough I was not able to move from feature file to step definition since it's not highlighting the step as link (ctr mouse over - windows machine - Eclipse). Can you suggest me how to overcome this.

Ответить
Krish K
Krish K - 08.03.2021 07:28

Clicking on your telegram link it says the link is expired

Ответить
Ashwin Vavilala
Ashwin Vavilala - 04.03.2021 10:46

Hi Naveen,
It's wonderful. Crystal clear explaination.

I have followed the similar steps mentioned in the video. But, in the feature file, (*.feature), i dont see any auto generated script file. I am using below configurations
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<junit.version>4.13.2</junit.version>
<cucumber.version>6.10.0</cucumber.version>
<maven.compiler.version>3.8.1</maven.compiler.version>
<maven.surefire.version>2.22.2</maven.surefire.version>
Eclipse version : eclipse-java-2020-12-R-win32-x86_64

Ответить
Hemangi Shelake
Hemangi Shelake - 27.02.2021 20:41

Hi Naveen, After updating cucumber as you suggested my existing cucumber turned into plain editor. Unable to run feature files now.Please help me

Ответить
Vishal Kulkarni
Vishal Kulkarni - 13.02.2021 08:57

Hi Naveen, i am trying to generate snippet from Feature file first time it generated snippet, after adding new feature file it is not executing and giving report. It is giving warning as You are using deprecated Main class. Please use io.cucumber.core.cli.Main. It is saying all scenarios passed but not giving step definition.

Ответить
Mallikarjuna Reddy V A
Mallikarjuna Reddy V A - 03.02.2021 17:52

Hi Naveen
is it possible to map one feature step Definition into another feature Step?

Ответить
Anusha Sai
Anusha Sai - 16.01.2021 17:16

HI Naveen
I have installed new software and tried to configure as cucumber project but still i am seeing warning as does not have matching glue code. Could you please suggest me how to remove the warning in the feature file.

Ответить
Akanksha Sikri
Akanksha Sikri - 09.01.2021 15:57

Hi Naveen, I am getting no glue code warning for the feature files. I have defined the step definitions and also installed latest cucumber plugin. I tried uninstalling and reinstalling the plugin still no luck. Could you please suggest some solution.

Ответить
social media
social media - 23.12.2020 09:49

Thank you so much Naveen for your videos. Your videos are crisp, to the point,covers all the information. We can study more in a lesser time because you don't beat around the bush. I am a fan

Ответить
Chirag
Chirag - 22.12.2020 18:10

Hi Naveen, I am getting a "No Definition Found" warning message in the feature file even though I have added all the Feature File Statement in Step Definition. Can you please help me?

Ответить