执行 SendKey 方法是会间歇性的出现失败情况
appium 1.3.4部分脚本:capabilities.setCapability("autoAcceptAlerts", true);capabilities.setCapability("resetKeyboard", true);
capabilities.setCapability("unicodeKeyboard", true);
capabilities.setCapability("full-reset", true);
driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
报错脚本1:
MobileElement mobileNumber = (MobileElement)driver.findElement(By.xpath("//UIAApplication/UIAWindow/UIATextField"));
mobileNumber.sendKeys("13818181818");
报错脚本2:
MobileElement sms_verify1 = (MobileElement) driver.findElement(By.xpath("//UIAApplication/UIAWindow/UIATextField"));
sms_verify1.sendKeys("8");
MobileElement sms_verify2 = (MobileElement) driver.findElement(By.xpath("//UIAApplication/UIAWindow/UIATextField"));
sms_verify2.sendKeys("8");
MobileElement sms_verify3 = (MobileElement) driver.findElement(By.xpath("//UIAApplication/UIAWindow/UIATextField"));
sms_verify3.sendKeys("8");
MobileElement sms_verify4 = (MobileElement) driver.findElement(By.xpath("//UIAApplication/UIAWindow/UIATextField"));
sms_verify4.sendKeys("8");
报错内容:
Exception in thread "main" org.openqa.selenium.WebDriverException: An error occurred while executing user supplied JavaScript. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 2.34 seconds问题描述:
在尝试想text组件中输入内容时,会间歇性的发生错误,虽然配置了resetKeyBoard,但是观察到键盘总会有不弹出的现象,导致用sendKeys失败报错,但有时又可以正常运行。使用setValue虽然不报错,但app会不继续执行。想请问一下是否有其他解决方案。
加个延迟时间 建议添加延迟 加个延迟 添加延迟试一下 添加延迟
页:
[1]