How can I generate html test report using python in my code -
from selenium import selenium import unittest, time, re import htmltestrunner class untitled(unittest.testcase): def setup(self): self.verificationerrors = [] self.selenium = selenium("localhost",4444,"*iexplore","http://google.com.ua/") self.selenium.start() def test_untitled(self): sel = self.selenium sel.open("/") sel.type("q", "home") sel.click("btng") sel.click("link=welcome home.com") sel.wait_for_page_to_load("30000") self.failunless(sel.is_text_present("results * selenium rc")) def teardown(self): time.sleep(25) self.selenium.stop() self.assertequal([], self.verificationerrors) if __name__ == "__main__": unittest.main()
when faced similar problem had override testresult
, testcase.defaulttestresult()
collect data number of lists convenient me. can use template library (jinja, mako, etc) turn html.
Comments
Post a Comment