Hey Yashmin, follow these steps to install and setup Pytest framework:
-
Pytest doesn't come with standard Python installation and needs to be installed separately. To install pytest, execute the following command on the command prompt:
-
Once the installation is complete, you can verify whether the installed pytest version, by typing the following command:
-
pytest --version

-
Next, for Pytest development you can download PyCharm Edu version from here: https://www.jetbrains.com/pycharm-edu/download/#section=windows
-
Once PyCharm is installed, navigate to File -> Settings -> Tools -> Python Integrated Tools and change Default test runner to Pytest for performing test automation using pytest with Selenium WebDriver:

-
Now install the Selenium package for Python to perform test automation using pytest with Selenium WebDriver by invoking the following command in PyCharm terminal:
And that's it, you have your pytest completely setup for Test Automation using Selenium Webdriver.