Как настроить IP прокси в appium? - PullRequest
0 голосов
/ 24 января 2019

Когда я настраивал прокси в appium, я сообщал о следующей ошибке

Я пытался решить эту проблему с помощью str или dict proxy.

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)
...