HTML报告没有为硒生成测试用例甚至没有空白报告

时间:2019-04-11 07:47:21

标签: python selenium selenium-webdriver

我尝试了一个简单的硒程序来生成HTML报告。测试用例运行完美,但未生成HTML报告。

from selenium import webdriver
import unittest
import HtmlTestRunner

# Keyword
url = 'https://amazon.in'
path = 'C:/bin/chromedriver.exe'


class amazonTest(unittest.TestCase):

  @classmethod
   def setUpClass(cls):
    cls.driver = webdriver.Chrome(executable_path=path)
    cls.driver.maximize_window()

   def test_openWebsite(self):
     self.driver.get(url)
     print(self.driver.title)

  @classmethod
    def tearDownClass(cls):
     cls.driver.close()
     cls.driver.quit()

if __name__ == '__main__':
   unittest.main(testRunner=HtmlTestRunner.HTMLTestRunner(output="C:/Users/tester/Desktop/PYTHON/sampleReport"))

0 个答案:

没有答案