報錯求助:Unsupported locator strategy: -ios predicate string

杨小溪發表於2020-05-27

一個簡單的 demo

DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("deviceName", "xxxx);
cap.setCapability("udid", "xxxxx");
cap.setCapability("platformName", "iOS");
cap.setCapability("startIWDP",true);
cap.setCapability("automationName","XCUITest");
cap.setCapability("browserName","Safari");
cap.setCapability("safariInitialUrl","xxxxxx");

IOSDriver driver = new IOSDriver(new URL("http://0.0.0.0:4723/wd/hub"),cap);
Thread.sleep(1000);
driver.findElement(MobileBy.iOSNsPredicateString("a")).click();

報錯資訊:

資訊: Detected dialect: W3C
Exception in thread "main" org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Unsupported locator strategy: -ios predicate string
Build info: version: '4.0.0-alpha-1', revision: 'd1d3728cae', time: '2019-04-24T13:42:21'
System info: host: 'B000000137278', ip: '2400:da00:c0c3:ff12:cf24:fd55:852c:4f21%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.4', java.version: '1.8.0_191'
Driver info: io.appium.java_client.ios.IOSDriver

望各位幫助,謝謝~

相關文章