错误:使用selenium在Python中编写测试

2024-10-03 04:37:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用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” 我不知道为什么我不能把司机分配给我自动驾驶. 我的自我传递正确吗?你知道吗


Tags: selfdefdriverseleniumsetupunittestfirefoxtestcase