我正在嘗試在 Sauce Labs 中設(shè)置我的第一個(gè) Appium 測(cè)試(不是本機(jī)或混合應(yīng)用程序),并且在嘗試設(shè)置我的功能時(shí)遇到 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'`這是我設(shè)置上限的方法: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 文件中運(yùn)行: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) 正確顯示所有內(nèi)容:Capabilities {appiumVersoin: 1.7.2, automationName: XCUITest, browserName: Safari, deviceName: iPhone Simulator, name: appiumTest, platformName: iOS, platformVersion: 11.2.2}
Appium Sauce Labs - 不支持的操作系統(tǒng)/瀏覽器/版本/設(shè)備組合
哆啦的時(shí)光機(jī)
2022-10-07 16:21:50