Python is also a widely used language for building Selenium WebDriver tests. It offers various ways to parameterize tests.
In this recipe, we will use the DDT module along with unittest to create a parameterized test.
You need to install the DDT module by using the following command:
pip install ddt
This command will download and install all the dependencies required for DDT on your machine.
Let's create a simple Python test for parameterization using the DDT module. Create a new Python file named bmi_calc_ddt.py
using the following code:
import unittest from ddt import ddt, data, unpack from selenium import webdriver @ddt class BmiCalcDDT(unittest.TestCase): def setUp(self): # create a new Firefox session self.driver = webdriver.Firefox() self.driver.implicitly_wait(30) self.driver.maximize_window() # navigate to the BMI Calculator page self.driver.get("http://bit...