How do I run scenarios in feature file by taking inputs from external file like excel or text or csv

1,555 views
Skip to first unread message

tejasvi manmatha

unread,
May 9, 2013, 12:51:40 PM5/9/13
to calaba...@googlegroups.com
My feature file is like this

  Scenario Outline: I am able to log into application
    Given I have entered email address "<email>" and password "<password>"
    Then I am navigated to user homepage

  Examples:
    | email                      | password |
    | us...@gmail.com | qa1234      |

My question:
With this feature file I can login into app and do my tests but the login details must have to be changed each time before running test,
Instead If i there is a way to send testdata from external file where I can change it once and all feature files reading from that extenal file can use new login details

Things I have tried
  • Use multiple lines of data in Examples
  •  Invoke a step and with step description start a method to read from excel file and then run tests by using it as data source

In simple I am looking for solution like this http://raveendran.wordpress.com/tag/data-driven-cucumber/ but for MAC

Thanks

Tej



Krukow

unread,
May 9, 2013, 1:40:16 PM5/9/13
to calaba...@googlegroups.com


On Thursday, May 9, 2013 6:51:40 PM UTC+2, tejasvi manmatha wrote:
[snip]

  •  Invoke a step and with step description start a method to read from excel file and then run tests by using it as data source

In simple I am looking for solution like this http://raveendran.wordpress.com/tag/data-driven-cucumber/ but for MAC


This would be the approach I'd recommend (unless there is importance in communicating the data to the business then don't put it in the feature).

- Karl
 

Thanks

Tej



tejasvi manmatha

unread,
May 10, 2013, 4:56:41 AM5/10/13
to calaba...@googlegroups.com
Krukow thanks for your reply !!

http://raveendran.wordpress.com/tag/data-driven-cucumber/ this doesnt work on mac due to some missing ruby gems.
I forgot to mention that.
Is there any alternative option similar to this ??

Thanks,
Tej

Krukow

unread,
May 10, 2013, 6:51:17 AM5/10/13
to calaba...@googlegroups.com
I meant:

 Invoke a step and with step description start a method to read from excel file and then run tests by using it as data source


not the data-driven-cucumber

- Karl
Reply all
Reply to author
Forward
0 new messages