列出了我的 python 脚本:
===========================================
class ExampleTestCase(unittest.TestCase):
capabilities = None
def setUp(self):
self.driver = webdriver.Remote(desired_capabilities={ "browserName": broswer, "platform": platform, "node": node })
def test_example(self):
self.driver.get("www.360logica.com")
self.assertEqual(self.driver.title, "360logica")
def tearDown(self):
self.driver.quit()
if __name__ == "__main__":
#unittest.main()
args = sys.argv
port = args[1]
platform = args[2]
broswer = args[3]
suite = unittest.TestSuite()
suite.addTest(ExampleTestCase("test_example"))
runner = XMLTestRunner(file('results_ExampleTestCase_%s.xml' % (broswer), "w"))
runner.run(suite)
===============================================
运行命令为:
$ ./python.exe Grid_1.py 5555 WINDOW firefox
===============================================
构建错误日志是:
$ ./python.exe Grid_1.py 5555 WINDOW firefox
Traceback (most recent call last):
File "Grid_1.py", line 31, in <module>
suite.addTest(ExampleTestCase("test_example"))
File "C:\Python27\Lib\unittest\case.py", line 191, in __init__
(self.__class__, methodName))
ValueError: no such test method in <class '__main__.ExampleTestCase'>: test_example
==================================================== =
请帮我。我对那个构建错误感到非常头疼,不知道如何修复它。