passing command line argument to python-behave

user3375505 picture user3375505 · Mar 20, 2014 · Viewed 11.6k times · Source

I am using python-behave for BDD testing, I have to pass an URL (e.g. www.abc.com) from command line.

$behave -u "www.abc.com" 

To achieve this, I have read behave documentation but there are not enough materials as well as explanations given for setting up the behave.ini file. I am also not sure how behave.ini file helps me to pass an argument.

Can someone please tell me how I can setup command line parameters for behave?

Answer

jenisys picture jenisys · Feb 20, 2015

The suggested solutions above were needed in the past.

behave-1.2.5 provides a "userdata" concept that allows the user to define its data:

behave -D browser=firefox ...

SEE ALSO: behave: userdata