Posts

Showing posts from April, 2022

Blog on selenium

  Test automation with Selenium WebDriver and pytest     A brief about Selenium WebDriver Selenium is an open-source tool that automates web application testing across numerous platforms such as Windows, Mac, and Linux. With Selenium, you can perform web testing against some of the popular browsers like Chrome, Firefox, Opera, Microsoft Edge, etc. It also supports various programming languages like Python, C#, Ruby, PERL, Java, etc. Selenium WebDriver is one of the core components of the Selenium framework. It is a collection of open-source APIs that are used to automate the testing of a web application. It allows test automation to open a browser, then sends clicks, type keys, scrape text, and finally exit the browser cleanly. There are particular drivers for the browsers that include Chrome, Firefox, Opera, Microsoft Edge.   driver = Chrome() - Chrome() initializes the ChromeDriver instance using the default options on your local machine. driver.impli...

Blog on Pytest

  Testing Python Applications with Pytest     Pytest is a testing framework and test runner for Python. In this guide, we will look at the most useful configuration and usage, including several pytest plugins and external libraries.   Pytest basics  Pytest will automatically scan our codebase for test modules, files following the file name convention test_*.py or *_test.py , and scan them for functions named test_*() . If we want to run tests defined as methods inside classes, we need to prefix the class names with Test . Pytest will also automatically pick up any tests written using unittest module.   Standard test functions and test runs from python_pytest . basics import add def test_add_can_add_numbers ( ) : # given num = 3 num2 = 45 # when result = add ( num , num2 ) # then assert result == 48 By default, fixtures are function-scoped, meaning that a fixture's lifetime is t...