求助大佬!!
求助大佬!!
求助大佬!!
AttributeError: 'TestBrowser' object has no attribute 'driver'
代码:
test_browser.py
from time import sleep
from appium import webdriver
class TestBrowser:
def setup(self):
des_caps = {
'platformName': 'android',
'platformVersion': '12',
'browserName': 'Browser',
'noReset': True,
'deviceName': 'emulator-5554'
}
self.driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", des_caps)
self.driver.implicitly_wait(6)
def teardown(self):
self.driver.quit()
def test_browser(self):
print("到底发生了什么如此报错??????????")
# self.driver.get('https://www.baidu.com')
self.driver.get("http://www.baidu.com")
sleep(6)
报错信息:
============================= test session starts =============================
collecting ... collected 1 itemtest_browser.py::TestBrowser::test_browser FAILED [100%]到底发生了什么如此报错??????????
test_browser.py:23 (TestBrowser.test_browser)
self = <test_browser.TestBrowser object at 0x000001A120DB3D00>def test_browser(self):
print("到底发生了什么如此报错??????????")
# self.driver.get('https://www.baidu.com')
> self.driver.get("http://www.baidu.com")
E AttributeError: 'TestBrowser' object has no attribute 'driver'test_browser.py:27: AttributeError