
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Python library provides customized Test Report for selenium or any other automation framework
A htmllogger is designed inorder to provide customized logs for autumated tests.
So user can able to write step log and test case details.
pip install:
> pip install htmllogger
Follow below examples for more understanding...
import unittest
from selenium import webdriver
from htmllogger.Htmllogger import HTMlLogger
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
class InputFormsCheck2(unittest.TestCase):
# Opening browser.
def setUp(self):
self.logger = HTMlLogger('Path of folder where we need to create report')
binary = FirefoxBinary('Binary Path for your browser')
self.driver = webdriver.Firefox(firefox_binary=binary,
executable_path=r"/geckodriver.exe")
# Testing Single Input Field.
def test_singleInputField(self):
self.logger.assert_testcase_log("Test Single Input Field") # ****Writting Test case Name
try:
pageUrl = "http://www.seleniumeasy.com/test/basic-first-form-demo.html"
driver = self.driver
driver.maximize_window()
driver.get(pageUrl)
# Finding "Single input form" input text field by id. And sending keys(entering data) in it.
eleUserMessage = driver.find_element_by_id("user-message")
eleUserMessage.clear()
eleUserMessage.send_keys("Test Python")
self.logger.assert_step_log("Entered text [Test Python] in [user-message] EditBox.") # ****Writting step log
# Finding "Show Your Message" button element by css selector using both id and class name. And clicking it.
eleShowMsgBtn = driver.find_element_by_css_selector('#get-input > .btn')
eleShowMsgBtn.click()
self.logger.assert_step_log("Clicked on [Show Message] Button.") # ****Writting step log
# Checking whether the input text and output text are same using assertion.
eleYourMsg = driver.find_element_by_id("display")
assert "Test Python" in eleYourMsg.text
except Exception as e:
self.logger.assert_step_fail_log(driver, str(e)) # Capturing failure
# Closing the browser.
def tearDown(self):
self.driver.close()
# This line sets the variable “__name__” to have a value “__main__”.
# If this file is being imported from another module then “__name__” will be set to the other module's name.
if __name__ == "__main__":
unittest.main()
Inside test_Login.py
import pytest
from selenium import webdriver
from htmllogger.Htmllogger import HTMlLogger
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
@pytest.fixture()
def setup(request):
print("initiating driver")
logger = HTMlLogger('Path of folder where we need to create report')
binary = FirefoxBinary('C:\\Program Files\\Mozilla Firefox\\firefox.exe')
driver = webdriver.Firefox(firefox_binary=binary,executable_path=r"D:/SeleniumTest/SeleniumTest/MainResources/drivers/geckodriver.exe")
request.instance.driver = driver
request.instance.logger = logger
driver.get("http://seleniumeasy.com/test")
driver.maximize_window()
yield driver
driver.close()
@pytest.mark.usefixtures("setup")
class TestExample:
def test_title(self):
try:
self.logger.assert_testcase_log("Testcase :Testing Title") # ****Writting Test case Name
print("Verify title...")
assert "Selenium Easy" in self.driver.title
self.logger.assert_step_log("Successfully verified title") # ****Writting step log
except Exception as e:
self.logger.assert_step_fail_log(self.driver, str(e))
def test_content_text(self):
self.logger.assert_testcase_log("Testcase : Testing Content")
try:
print("Verify content on the page...")
centerText = self.driver.find_element_by_css_selector('.tab-content .text-center').text
self.logger.assert_step_log("Verify content on page")
assert "WELCOME TO SELENIUM EASY DEMO" == centerText
except Exception as e:
self.logger.assert_step_fail_log(self.driver, str(e)) #****Capturing failure
FAQs
Python library provides interactive test report for selenium
We found that htmllogger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.