[JVM] How to take testdata from excel spreadsheet to feed Cucumber-JVM tests (with Webdriver )

1,582 views
Skip to first unread message

Isaac Mova

unread,
Jul 1, 2013, 3:18:56 PM7/1/13
to cu...@googlegroups.com
Hi,

Any ideas on data parameterization with Excel for Cucumber-JVM tests on WebDriver.

I know that we take test data from feature files most of the times, but is there a way that we can feed test data from spreadsheet like how TestNG supports parameterization.

The reason why i am asking this is, i do not want to give system admin login details in feature files or some config.java file. I just want to keep all this data in a excel workbook and use it repeatedly. 




Regards,
Isaac

aslak hellesoy

unread,
Jul 1, 2013, 3:28:32 PM7/1/13
to Cucumber Users
You can read Excel sheets with Apache POI in your step definitions.

Aslak
 


Regards,
Isaac

--
-- Rules --
 
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
 
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Peter DoMySEO

unread,
Jul 6, 2013, 6:41:58 AM7/6/13
to cu...@googlegroups.com

Srisowrabha Kumar

unread,
Nov 7, 2014, 5:49:42 AM11/7/14
to cu...@googlegroups.com, isaac....@gmail.com
Hi Aslak,

May I know, once we read the data from the spread sheet, how Cucumber enters the value into the required field? For instance, below is my step definition method which enters value into a text field.

@And("Enter Person in \"([^\"]*)\" field \"([^\"]*)\"")
public void enterPersonName(String fieldLabel, String value){
String locator = getLocator("textFieldWithLabel").replaceAll("toReplaceWithFieldLabel", fieldLabel); // This syntax will read an xpath from a property file and replace few stuffs
type(locator, value);
}

Here, I need to enter "value" into a text field. If I have written a method to read a spread sheet and return a value, how does Cucumber do this job, as I have specified in the "And" annotation to look for the value from the feature file.

Thanks,
Sowrabha

Aslak Hellesøy

unread,
Nov 7, 2014, 6:18:30 AM11/7/14
to cu...@googlegroups.com, isaac....@gmail.com

On Friday, 7 November 2014 at 05:49, Srisowrabha Kumar wrote:

Hi Aslak,

I have a policy to not answer questions directed at me personally on this list.

Please send a new email where you're addressing the group.

Thanks!
Aslak 

---
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.
For more options, visit https://groups.google.com/d/optout.

Srisowrabha Kumar

unread,
Nov 7, 2014, 8:01:38 AM11/7/14
to cu...@googlegroups.com, isaac....@gmail.com
Very sorry. As a thread already existed, thought of posting here.

Suresh Sa

unread,
Jun 23, 2016, 4:34:08 PM6/23/16
to Cukes, isaac....@gmail.com
Hi,

Do u have solution for this on. Right now I am searching solution for this one.

Thanks,
Suresh

Roberto Lo Giacco

unread,
Jun 25, 2016, 7:26:47 AM6/25/16
to Cukes, isaac....@gmail.com


Il giorno giovedì 23 giugno 2016 22:34:08 UTC+2, Suresh Sa ha scritto:
Hi,

Do u have solution for this on. Right now I am searching solution for this one.

Why do you expect Cucumber to infer the data from your spreadsheet? Cucumber is unaware of your rows/columns all together. Aslak was suggesting to read the data from the csv/excel within a step implementation and do whatever you want with that data, he never said Cucumber parser will ever be aware of that data.

Are you sure you are not trying to use Cucumber as a testing framework? Do those data have a meaning in defining your business requirement?
Reply all
Reply to author
Forward
0 new messages