Using selenium pytest fixtures at class level | creating base_test.py for all test files

preview_player
Показать описание
This video will explain,
How to use pytest fixtures at class level of other files
We can even write as many as test methods in one file without any modification to driver setup & teardown.

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 -
Рекомендации по теме
Комментарии
Автор

sir why i have fixture 'setup' not found? my def get data cannot read properly in my class that i wan to run pytets

hubertusrino
Автор

Also getting Unresolved attribute reference 'driver' for class in the test_saucedemo_fixture1 file, Any further help? As far as i see, code is exact as per video

ColinHill-ug
Автор

Hello man, these guides are very useful thanks. I had a question about selenium. do u know how i can upload a file from a directory on my pc to one of those "look for file" windows that open when you want to upload a file to a website?
or
how i can upload a file to one of those drag and drop file upload areas?

arm
Автор

I hope you can help. When using fixtures at method level, i get code completion when typing driver. etc. However, when using fixtures at class level, pycharm is not providing autocomplete for driver. Its not showing any of the driver methods i.e. get or find_element etc. The tests all run fine but no autocomplete.

robthomson
Автор

Hi I have tried using the fixture at class level, but I am getting the warning in Pycharm for driver "Unresolved attribute reference driver for class <className>. Any way to resolve this warning? I am using Python version 3.11.7. I have tried 3.12 as well. The same issue.

bhawnagarg