我正在尝试在 Sauce Labs 中设置我的第一个 Appium 测试(不是本机或混合应用程序),并且在尝试设置我的功能时遇到 WebDriverException:org.openqa.selenium.WebDriverException: Unable to parse remote response: Misconfigured -- Unsupported OS/browser/version/device combo: OS: 'unspecified', Browser: 'iphone', Version: '11.2.2.', Device: 'iPhone Simulator'`这是我设置上限的方法:public static DesiredCapabilities CreateAppiumCapabilities(String browser, String version, String platform,String device, String methodName) { DesiredCapabilities caps = new DesiredCapabilities(); caps.setCapability(MobileCapabilityType.PLATFORM_NAME, platform); caps.setCapability(MobileCapabilityType.PLATFORM_VERSION, version); caps.setCapability(MobileCapabilityType.DEVICE_NAME, device); caps.setCapability(MobileCapabilityType.AUTOMATION_NAME,"XCUITest"); caps.setCapability(MobileCapabilityType.BROWSER_NAME, browser); caps.setCapability("appiumVersoin", "1.7.2"); caps.setCapability("name", methodName); System.out.println(caps); return caps;然后,在我的 testBase.java 文件中运行:private ThreadLocal<IOSDriver> iosDriver = new ThreadLocal<IOSDriver>();.........DesiredCapabilities capabilities = SauceUtils.CreateAppiumCapabilities(browser, version, platform, device, methodName); String url = SauceUtils.getURL(); iosDriver.set(new IOSDriver(new URL(url), capabilities)); sessionId.set(((IOSDriver) getIosDriver()).getSessionId().toString());System.out.println(caps) 正确显示所有内容:Capabilities {appiumVersoin: 1.7.2, automationName: XCUITest, browserName: Safari, deviceName: iPhone Simulator, name: appiumTest, platformName: iOS, platformVersion: 11.2.2}
1 回答
慕的地6264312
TA贡献1817条经验 获得超6个赞
从上面粘贴的代码中可以看出,“appiumVersion”功能中有一个错字:
caps.setCapability("appiumVersoin", "1.7.2");
应该
caps.setCapability("appiumVersion", "1.7.2");
添加回答
举报
0/150
提交
取消