class Auto(): def open_Foxmail(self, host='http://127.0.0.1', port=4723): # 打开WinAppDriver服务 # 注意:如果手动开启,则可以注释掉 # os.system(r'start "" /d "C:\Program Files\Windows Application Driver\" "WinAppDriver.exe"') # 配置信息 # 包含:平台名、系统、应用程序绝对路径 desired_caps = {'platformName': 'Windows', 'deviceName': 'WindowsPC', 'app': r"D:\Foxmail\Foxmail.exe"} try: # 连接WinAppDriver服务,打开目标软件 self.driver = webdriver.Remote('http://{}:{}'.format(host, port), desired_caps) except Exception as e: raise AssertionError(e) Traceback (most recent call last): File "D:\projects\AutoTest\demo\test.py", line 26, in <module> auto.open_Foxmail() ~~~~~~~~~~~~~~~~~^^ File "D:\projects\AutoTest\demo\test.py", line 23, in open_Foxmail raise AssertionError(e) AssertionError: missing 1 required keyword-only argument: 'options' (instance of driver `options.Options` class)