在appium中设置代理时,我报告了以下错误
我试图用str或dict代理解决它。
class Moments(object):
def __init__(self):
self.desired_caps = {
"platformName": "Android",
"deviceName": "6EJ4C18801000055",
"appPackage": "com.tencent.mm",
"appActivity": ".ui.LauncherUI",
"unicodeKeyboard": True,
"resetKeyboard": True,
"noReset": True
}
self.driver = webdriver.Remote(driver_server, self.desired_caps, proxy={"http": 'http://122.7.226.222:4258'})
结果是:
AttributeError:'dict'对象没有属性'add_to_capabilities'
当它是str时:AttributeError:'str'对象没有属性 'add_to_capabilities'
源代码如下:
if proxy is not None:
warnings.warn("Please use FirefoxOptions to set proxy", DeprecationWarning, stacklevel=2)
proxy.add_to_capabilities(capabilities)