我正在尝试使用selenium和pythonwebdriver编写一个自动化测试
class UserAccountsTest(unittest.TestCase):
def setup(self):
self.driver=webdriver.Firefox()
def testFirstUser(self):
driver = self.driver
driver.implicitly_wait(15)
driver.get('website.com')
driver.implicitly_wait(15)
我的错误: 对象没有属性“driver” 我不知道为什么我不能把司机分配给我自动驾驶. 我的自我传递正确吗?你知道吗
您需要调用
setup()
函数setUp()
,如unittest wiki中所述。你知道吗相关问题 更多 >
编程相关推荐