A little more detail about using Pytest with Selenium:

Basically Pytest is a library that can be integrated with Selenium Library to automate regression test cases and just like testng pytest offers a lot of possibilities that makes handling the tests in automation very easy. Pytest is a python based library and therefore requires python to be installed on your machine before you install pytest and configure your python project with Pytest.

After python is installed it offers a installation tool called pip through which we can install Pytest library, Selenium, Allure-Pytest needed for reporting purposes. You also need a IDE to write your test scripts and the tests that in turn check whether the testscript is executed or not and then report it at the end in Allure Reports.

All the installations can happen inside of Pycharm IDE where you have option to install the required packages from the internet. In Eclipse there is market place here it is the internet. Pycharm helps you install all the necessary packages.

So coming to Automation Framework the basic need of Framework is to automate the test cases into test scripts. Selenium Library helps us in identifying the web elements of the application, while Pytest allows us to write tests that check the automation scripts, group them using decorators such as Markers and Fixtures and then finally calling the Reporting library of Allure-Pytest and Allure Commons.

You can also design it in the Page Object Model format which is commonly used across automation frameworks, and here there is an option if specifying Global variables inside a separate file called Conftest.py.


要查看或添加评论,请登录

Ganesha Swaroop B的更多文章

社区洞察

其他会员也浏览了