TA的每日心情 | 开心 2016-1-12 17:09 |
---|
签到天数: 1 天 连续签到: 1 天 [LV.1]测试小兵
|
从Selenium IDE里export test case as Python 2/unittest/Remote Control导出python的脚本如下:
# -*- coding: utf-8 -*-
from selenium import selenium
import unittest, time, re
class remote_python_baidu(unittest.TestCase):
def setUp(self):
self.verificationErrors = []
self.selenium = selenium("localhost", 4444, "*chrome", "https://www.baidu.com/")
self.selenium.start()
def test_remote_python_baidu(self):
sel = self.selenium
sel.open("/")
sel.click("id=kw")
sel.type("id=kw", "python")
sel.click("id=su")
def tearDown(self):
self.selenium.stop()
self.assertEqual([], self.verificationErrors)
if __name__ == "__main__":
unittest.main()
在Python里执行总报错:
E
======================================================================
ERROR: test_remote_python_baidu (__main__.remote_python_baidu)
----------------------------------------------------------------------
Traceback (most recent call last):
File "D:\auto_test\remote_python_baidu.py", line 8, in setUp
self.selenium = selenium("localhost", 4444, "*chrome", "https://www.baidu.com/")
TypeError: 'module' object is not callable
----------------------------------------------------------------------
Ran 1 test in 0.020s
FAILED (errors=1)
请问是什么原因引起的?
|
|