How to Pass the value to a variable in terminal #1204
-
| Hi Michael,  | 
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 14 replies
-
| Hi @abdurraheemj You can set the environment via the command-line using built-in environments that map to  pytest --env=qa
pytest --env=productionIn tests, access with  | 
Beta Was this translation helpful? Give feedback.
-
| @abdurraheemj You already had the right idea with: if self.env == "qa":
    self.open(QA_URL)
elif self.env == "production":
    self.open(PRODUCTION_URL)Those parameters get set on the command-line with: pytest --env=qa
pytest --env=production | 
Beta Was this translation helpful? Give feedback.

Hi @abdurraheemj You can set the environment via the command-line using built-in environments that map to
self.env:In tests, access with
self.env. You'll have to type out "production" when using that one.Then you can use that within
ifstatements.