this is my code
I don"t know how to open file
or it may not be generated at all
busy
busy
from selenium import webdriver
import unittest, time
import HTMLTestRunner
class MyTest(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome()
self.driver.maximize_window()
self.driver.implicitly_wait(10)
self.base_url = "http://www.baidu.com"
def test_baidu(self):
driver = self.driver
driver.get(self.base_url + "/")
driver.find_element_by_id("kw").clear()
driver.find_element_by_id("kw").send_keys("HTMLTestRunner")
driver.find_element_by_id("su").click()
def tearDown(self):
self.driver.quit()
if __name__ == "__main__":
testSuite = unittest.TestSuite()
testSuite.addTest(MyTest("test_baidu"))
Html = ".\\result.htm"
fp = file(Html, "wb")
runner = HTMLTestRunner.HTMLTestRunner(stream=fp, title=u"", description=u":")
runner.run(testSuite)
fp.close()
Some help please with my code to generate the html report.
Thanks, Chris