显示webdri中的错误

2024-06-12 05:30:36 发布

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

我用python编写了一个单元测试用例,用于自动化我的应用程序的登录屏幕。我在用Appium。我在下面的一行中出错了。我已经设置了所需的功能。你知道吗

desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '6.0.1'
desired_caps['deviceName'] = 'Redmi 3S'
desired_caps['app'] = '/Users/sanju/Desktop/myapp.apk'



class Utils(object) :
@staticmethod

def initialswipes(driver):
    for _ in range(0, 5):
        try :
            driver.execute_script("mobile: swipe", {"direction": "left"})
        except WebDriverException :
            return False
    return True


class MyTestCase(unittest.TestCase):
def test_something(self):
   driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

错误是: 文件“/Users/sanju/PycharmProjects/Android/登录.py“,第37行,在测试中” 驱动程序=webdriver.远程('http://localhost:4723/wd/hub',所需的\u大写)


Tags: localhosthttpreturndefdrivercapsusersclass