class TestSimple(object):
@classmethod
def setup_class(cls):
print("------ setup before class TestSimple ------")
desired_caps = {
'platformName': 'Android',
'platformVersion': '5.1.1',
'deviceName': '127.0.0.1:21503',
'appPackage': 'com.seafile.seadroid2',
'appActivity': '.ui.activity.BrowserActivity',
'sessionOverride': True,
'unicodeKeyboard': True,
'resetKeyboard': False,
'noSign': True,
'noReset': True
}
cls.driver = webdriver.Remote(command_executor='http://127.0.0.1:4723/wd/hub', **desired_caps)
cls.driver.implicitly_wait(10)
def test_login_success(self):
print(123)
# 进行其他操作...
@classmethod
def teardown_class(cls):
print("------ teardown after class TestSimple ------")
cls.driver.quit()
运行后报错AttributeError: 'NoneType' object has no attribute 'to_capabilities'
我使用的是appium+python 3.0的版本,运行后html正常生成,但是测试用例error