I have feature file Scenario like below. Here instead of specifying the input into the "Examples" section , i want to read from external CSV file.
My step file ( where i write step definition ) is in java language.
I googled a lot before posting into this forum, but i couldnt find any solution for java on how to read input from CSV file into feature file. I found some solution for ruby.
But we are not using ruby language to write step defintion.
Scenario Outline: Testing to verify service returns till date response when passing all the mandatory parameters
When I pass the CIF <CIF>,BU <BU>
And I hit the service
And I Check for the Success Status Code
Examples:
|CIF|BU|
| 12345|58|
| 98765|59|
I could write the new step , for e.g. Read data from <File> , corresponding step defintion (java file) - read the values from CSV and assign to variables like CIF , BU.However problem is i wanted to run the same scenario for different data set ( for e.g. for second record in table), value of variables like BU , CIF should change.my CSV file is like data.csvCIF,BU
12345,58
98765,59
I had similar issue , let see what issue I tried to solve:
I have a 100+ feature file, and each feature file have scenario outlines ex.
Below is one feature file
Scenario outline: As a user I should be able to create a new client
Given I am app home page
Then I input <fname> in first name
And I input <lname> in last name
And I selected city as <city name>
And I enter biuilding <bld name>
And I enter taf type as <taf>
Example:
|fname|lname|city_name|bld_name|taf|
Now the challenge is application shows different set of values for 'city', 'bld' and 'taf' which depends on which type of customer loggedin. And we had 6type of customer. And at a time I need to check of one customer type. So to test all 6 customers types I have below option:
So I tried in 2nd way , there is no straight forward way but I did a work around here.
Scenario outline: As a user I should be able to create a new client
Given I am app home page
Then I input <fname> in first name
And I input <lname> in last name
And I selected city as <city name>
And I enter biuilding <bld name>
And I enter taf type as <taf>
Example:
Note: No data in Example:
Note: It's just a work around to solve different set of data problem. Hope it may help some one
Let me know if need any help.
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe@googlegroups.com.
Hi shailendra ,I have been looking for a solution to this problem .Could you please send your utility class to this email id - sharank...@gmail.com
'|| ||` '||'''|, .|''''|, '||\ ||` .|'''''| || || || || || || || ||\\ || || . || || /\ || ||...|' || || || \\ || || |''|| || \\//\\// || \\ || || || \\|| || || \/ \/ .|| \\. `|....|' .|| \||. `|....|' ||
Hi Shailendra,Could you please share the same utility with me.to archive the same way -1. created feature file2. then running the script3. copy the feature file with different name4. replacing or writing the data from excel to feature file5. then deleting the old feature filebut some how its not working correctly.
Some of these comments are getting a bit too personal for my liking. Let's please keep it respectful, however daft we think other people's ideas might be 😀
❤️ https://github.com/cucumber/cucumber/blob/master/CODE_OF_CONDUCT.md ❤️
Some of these comments are getting a bit too personal for my liking. Let's please keep it respectful, however daft we think other people's ideas might be 😀
❤️ https://github.com/cucumber/cucumber/blob/master/CODE_OF_CONDUCT.md ❤️
You received this message because you are subscribed to a topic in the Google Groups "Cukes" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cukes/r253wWXJv80/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cukes+unsubscribe@googlegroups.com.
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+unsubscribe@googlegroups.com.
Hi Shailendra,I am working on a similar functionality and looking for a solution where we can read and pass data to feature file from an external data file.Could you please share the utility or guide me accordingly?
Oops. Wrong screenshot.
--
Thanks for this comment.Sorry for grave-digging, but I felt the need to mention that not everyone is using Cucumber for it's intended use; hence there are some "unusual" requests or questions.In my case this feature would be really useful.Although I already have a workaround but I would actually prefer linking data files in the Examples: section.
We normally use Cucumber for our rest api integration tests, and there is already implemented a lot of supporting code for this.In this case we use it as intended, and I agree that it would be wrong to link data files.But, there was a need to have a way of creating data against a non-production installation (e.g. for demos).There are of course many ways to achieve this, even outside of Cucumber.But since we already have everything we need in Cucumber, we decided to create a separate feature set that would be only used for this reason.So there's no right or wrong way of using a tool.Please stop screaming that it's wrong.And to be honest, apparently there's an actual need for this feature no matter how hard you scream it's wrong :)
I don't really understand what would be the harm in implementing it and just mark it as non-conforming or something.Cucumber lacks many features that other competitor software has, and maybe I start to understand why :)
On Friday, October 13, 2017 at 9:17:31 PM UTC+2, Matt Wynne wrote:Some of these comments are getting a bit too personal for my liking. Let's please keep it respectful, however daft we think other people's ideas might be 😀
❤️ https://github.com/cucumber/cucumber/blob/master/CODE_OF_CONDUCT.md ❤️
--
Posting rules: http://cukes.info/posting-rules.html
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
Some further Details and code on bitbucket
https://bitbucket.org/idensitylab/cucumber-features-pp-maven-plugin/overview
kind regards
Wolfgang