passing url as a parameter through command line Selenium/Python

Viewed 43

I have the following piece of code:

def go_to_dev_vesting():
    driver.instance.get('https://example.com/')
    driver.instance.maximize_window()

How would I approach having that example URL passed as an argument through the command line when I run my tests?

For example:

pytest -m test_suite --url='https://someotherwebsite.com'

I would like to have the ability to dynamically change URLs since I have several environments that I would like to test (local, staging, production, etc)

Thank you for your help!

0 Answers
Related