✨ Web Automation Testing using Selenium WebDriver, Python, & POM design pattern ✨
What will be used on this project
Item | Source |
---|---|
Editor | VS Code (https://code.visualstudio.com/download) |
Package Manager | PIP (https://pip.pypa.io/en/stable/getting-started/) |
UI Test Tools | Selenium WebDriver with Python (https://pypi.org/project/selenium/) |
WebDriver Manager (https://pypi.org/project/webdriver-manager/) | |
Design Pattern | Selenium POM or Page Object Model |
Test Reporter | Pytest HTML (https://pytest-html.readthedocs.io/en/latest/) |
Browser | Latest version of Chrome / Mozilla Firefox |
Install VS Code Editor, Python, and PIP
To check whether you already installed Python & PIP
python --version
python -m pip --version
Install Selenium
python -m pip install Selenium
Install Web Driver Manager
python -m pip install webdriver-manager
👉 Clone this Repository through Terminal or Command Prompt
Open this Automation Project using VS Code Editor.
Change to Project directory on Terminal or Command Prompt
cd SeleniumPOM
Run Specific Test Execution on Terminal
python -m unittest TestCases/test_login.py
Run All Test Execution on Terminal
python -m unittest
Note: By default the Tests run on Chrome Browser
To run on Firefox Browser, change the browser on TestCases/test_login.py and TestCases/test_product.py file
# self.browser = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()))
self.browser = webdriver.Firefox(service=FirefoxService(GeckoDriverManager().install()))
Install Pytest-HTML Reporter
python -m pip install pytest-html
Run Selenium with the HTML Reporter
Note: Please wait until all test execution finished
python -m pytest --html=report.html
Test Execution HTML Report available on SeleniumPOM/report.html