Fetch data from pytest command line arguments like browserName env etc

preview_player
Показать описание
This video will explain how to
fetch the pytest command line parameters and use in selenium python framework.
We will parse the parameters from the command line and fetch the values.
This is mostly used when we want to run our tests from jenkins or azure dev ops pipeline, where the browserName environment etc should be dynamic.

pytest fixtures -

Selenium with python video tutorial series -

Selenium with python blog series -

Repo -

You can subscribe to this YouTube channel here -

Tech Blog - all my learnings, practice & experiences are recorded here -

GitHub projects -

Sample html elements to practice automation -

Follow on Twitter -

Join the Facebook group -

Like the Facebook page -
Рекомендации по теме
Комментарии
Автор

Getting :
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --browser chrome
inifile: None

iamvalsky
Автор

Hi, My pytest can't collect the Browser when i run my test how to i fix this plz reply?(it's showing collect 0 items ) ☹☹

venkateshr
Автор

Hi, Can you please add some more details and explain more on "request.cls", "request.config" and "request.config.getoption" objects. In my automation code they are not adding the "addoption" but they are checking like below.
if hasattr(request.config, "result_folder"):
result_dir =

arun
Автор

can you please explain how can we read config from a config file.config file to be passed from command line.

memisen
Автор

Also this code not able to find in github, please mention the correct path.

arun
Автор

One of the best Tutorial... Thanks a lot...

Bipulku
Автор

It looks like your github projects are marked as private. Both github links go to a 404

kevinlao