How to read data from properties file instead of a feature file in Cucumber BDD Framework? -


i have scenario want log in multiple users, cucumber provides scenario outline examples perform action requires user details entered in feature file. there way keep user details in properties file , call there in step definition class?

if there is, can please provide me example code gmail login scenario? using junit cucumber framework,any suggestion junit highly appreciated.

thanks fola

i've been searching sorta same thing , found lot of ridiculous "answers" this. overly complicated, when super easy.

my goal read .txt file here solution in ruby.

#inject environment properties given /^i enter environment url field$/  file.open("/path/to/your/env.txt") |envfile|     envfile.each_line |environment|         puts environment         keyboard_enter_text environment         end     end end 

now jenkins can create parameterized build writes properties file. viola you're tests dynamic, enjoy!


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -