Appium 报错求助:Unsupported locator strategy: -ios predicate string

杨小溪 · 2020年05月27日 · 最后由 大海 回复于 2020年05月30日 · 2368 次阅读

一个简单的 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

望各位帮助,谢谢~

共收到 1 条回复 时间 点赞

Original error: Unsupported locator strategy: -ios predicate string

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册